mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 19:25:16 +00:00
21 lines
464 B
Go
Executable File
21 lines
464 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/micro/services/clients/go/user"
|
|
)
|
|
|
|
// Create a new user account. The email address and username for the account must be unique.
|
|
func CreateAnAccount() {
|
|
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := userService.Create(&user.CreateRequest{
|
|
Email: "joe@example.com",
|
|
Id: "usrid-1",
|
|
Password: "mySecretPass123",
|
|
Username: "usrname-1",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|