GoodMemGoodMem
ReferenceSdkV2Go

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.

HTTPGET /v1/users/&#123;id&#125;

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.Email

Example 2:

user, err := client.Users().Get(ctx, &goodmem.UsersGetOptions{Email: goodmem.Ptr("[email protected]")})
if err != nil {
	log.Fatal(err)
}
_ = user.UserID

func (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.

HTTPGET /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.Email

type UserResponse

type UserResponse struct{ … }

User information response

  • UserID (string, wire userId) — The UUID of the user
  • Email (string, wire email) — The user's email address
  • DisplayName (string, wire displayName) — The user's display name
  • Username (string, optional, wire username) — The user's username (optional)
  • CreatedAt (int64, wire createdAt) — Timestamp when the user was created (milliseconds since epoch)
  • UpdatedAt (int64, wire updatedAt) — Timestamp when the user was last updated (milliseconds since epoch)