users

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: 18 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 {
	V2 clients.V2

	// Cache is used to cache the resources fetched inside the service.
	Cache *core.Cache
}

Client is the client for the User service.

func New

func New(v2 clients.V2, cache ...*core.Cache) *Client

New creates a new User service client.

func (*Client) ApiKeys

func (c *Client) ApiKeys() api.ApiKeys

ApiKeys returns the client for the ApiKeys service.

func (*Client) Discover

func (c *Client) Discover(opts ...opts.DiscoverOpts) ([]body.UserReadDiscovery, error)

Discover returns a list of users that the requesting user has access to.

It uses search param to enable searching in multiple fields. If UserID is provided, it returns a single user.

func (*Client) Exists

func (c *Client) Exists(id string) (bool, error)

Exists checks if a user exists

This does not use AuthInfo

func (*Client) FetchGravatar

func (c *Client) FetchGravatar(userID string) (*string, error)

FetchGravatar checks if the user has a gravatar image and fetches it if it exists. If the user does not have a gravatar image, it returns nil.

func (*Client) Get

func (c *Client) Get(id string, opts ...opts.GetOpts) (*model.User, error)

Get gets a user

func (*Client) GetByApiKey

func (c *Client) GetByApiKey(apiKey string) (*model.User, error)

GetByApiKey gets a user by their API key

func (*Client) GetUsage

func (c *Client) GetUsage(userID string) (*model.UserUsage, error)

GetUsage gets the usage of a user, such as number of deployments and CPU cores used

func (*Client) List

func (c *Client) List(opts ...opts.ListOpts) ([]model.User, error)

List lists users

func (*Client) ListTestUsers

func (c *Client) ListTestUsers() ([]model.User, error)

func (*Client) RefreshTeam

func (c *Client) RefreshTeam(id string, tmc *team_repo.Client) (*model.Team, error)

RefreshTeam refreshes the Team with the given ID. After a successful fetch, the Team will be cached.

func (*Client) RefreshUser

func (c *Client) RefreshUser(id string, umc *user_repo.Client) (*model.User, error)

RefreshUser refreshes the User with the given ID. After a successful fetch, the User will be cached.

func (*Client) Synchronize

func (c *Client) Synchronize(authParams *model.AuthParams) (*model.User, error)

Synchronize creates a user or updates an existing user. It does nothing if no auth info is provided.

It does not use AuthInfo as it is meant to be used by the auth service.

func (*Client) Team

func (c *Client) Team(id string, tmc *team_repo.Client) (*model.Team, error)

Team returns the Team with the given ID. After a successful fetch, the Team will be cached.

func (*Client) Teams

func (c *Client) Teams(tmc *team_repo.Client) ([]model.Team, error)

Teams returns a list of Teams. After a successful fetch, the Teams will be cached.

func (*Client) Update

func (c *Client) Update(userID string, dtoUserUpdate *body.UserUpdate) (*model.User, error)

Update updates a user

func (*Client) User

func (c *Client) User(id string, umc *user_repo.Client) (*model.User, error)

User returns the User with the given ID. After a successful fetch, the User will be cached.

func (*Client) Users

func (c *Client) Users(umc *user_repo.Client) ([]model.User, error)

Users returns a list of Users. After a successful fetch, the Users will be cached.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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