Files
services/examples/user/create/go/createAnAccount.go
2021-09-16 12:52:36 +01:00

20 lines
463 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/user"
"os"
)
// 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)
}