Users
package goodmem // import "fury.io/pairsys/goodmem"User lookup by id, email, or me.
Methods are called as client.Users().<Method>(ctx, ...) on a *goodmem.Client. Service: UsersService.
Index
type UsersService
type UsersService struct{ … }
Access this service as client.Users() on a *goodmem.Client. Its methods follow.
func (s *UsersService) Get
func (s *UsersService) Get(ctx context.Context, opts *UsersGetOptions) (*models.UserResponse, error)
Retrieves a user by ID or email address. Exactly one of id and email must be provided.
HTTP — GET /v1/users/{id}
Parameters
ctx(context.Context) — carries the deadline and cancellation signal for the call.opts(*UsersGetOptions) — options bag carrying the lookup key(s) / convenience knobs. Set the documented fields; the linked pkg.go.dev page lists them all.
Returns — (*models.UserResponse, error)
Examples
Example 1:
user, err := client.Users().Get(ctx, &goodmem.UsersGetOptions{ID: goodmem.Ptr("your-user-id")})
if err != nil {
log.Fatal(err)
}
_ = user.EmailExample 2:
user, err := client.Users().Get(ctx, &goodmem.UsersGetOptions{Email: goodmem.Ptr("[email protected]")})
if err != nil {
log.Fatal(err)
}
_ = user.UserIDfunc (s *UsersService) Me
func (s *UsersService) Me(ctx context.Context) (*models.UserResponse, error)
Retrieves the authenticated user's profile information including email, display name, and creation time. This endpoint does not require any parameters as it automatically returns the caller's information.
HTTP — GET /v1/users/me
Parameters
ctx(context.Context) — carries the deadline and cancellation signal for the call.
Returns — (*models.UserResponse, error)
Example
user, err := client.Users().Me(ctx)
if err != nil {
log.Fatal(err)
}
_ = user.Emailtype UserResponse
type UserResponse struct{ … }
User information response
UserID(string, wireuserId) — The UUID of the userEmail(string, wireemail) — The user's email addressDisplayName(string, wiredisplayName) — The user's display nameUsername(string, optional, wireusername) — The user's username (optional)CreatedAt(int64, wirecreatedAt) — Timestamp when the user was created (milliseconds since epoch)UpdatedAt(int64, wireupdatedAt) — Timestamp when the user was last updated (milliseconds since epoch)