user_repo

package
v0.0.0-...-e71a76f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	base_clients.ResourceClient[model.User]
}

Client is used to manage users in the database.

func New

func New() *Client

New returns a new user client.

func (*Client) GetEmail

func (client *Client) GetEmail(id string) (string, error)

GetEmail returns the email for the given user ID.

func (*Client) LastAuthenticatedAfter

func (client *Client) LastAuthenticatedAfter(lastAuthenticatedAt time.Time) *Client

LastAuthenticatedAfter filters the users to only those who have authenticated after the given time.

func (*Client) ListEmails

func (client *Client) ListEmails(ids ...string) (map[string]string, error)

ListEmails returns a list of emails for the given user IDs.

func (*Client) SetGravatar

func (client *Client) SetGravatar(id string, url string) error

SetGravatar updates the gravatar URL for the user.

func (*Client) Synchronize

func (client *Client) Synchronize(id string, params *model.UserSynchronizeParams) (*model.User, error)

Synchronize creates a new user or updates an existing user.

func (*Client) UnsetGravatar

func (client *Client) UnsetGravatar(id string) error

UnsetGravatar removes the gravatar URL for the user.

func (*Client) UpdateWithParams

func (client *Client) UpdateWithParams(id string, params *model.UserUpdateParams) error

UpdateWithParams updates the user with the given params.

func (*Client) WithApiKey

func (client *Client) WithApiKey(apiKey string) *Client

WithApiKey filters the users to only those with the given API key.

func (*Client) WithPagination

func (client *Client) WithPagination(page, pageSize int) *Client

WithPagination adds pagination to the client.

func (*Client) WithSearch

func (client *Client) WithSearch(search string) *Client

WithSearch searches the `users` collection for the given search string. It uses the text index on the `users` collection to search.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL