client

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClient = errors.New("users client api failed")
)

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides options for configuring the creation of a users client.

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

WithTLSConfig sets the http client's tls config.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the client timeout.

type UsersClient

type UsersClient struct {
	// contains filtered or unexported fields
}

UsersClient provides a client for the users api.

func New

func New(baseURL string, opts ...Option) (*UsersClient, error)

New returns a new client for the users api.

func (UsersClient) AssociatePlayer

func (c UsersClient) AssociatePlayer(ctx context.Context, id user.ID, req user.AssociatePlayer) (*user.User, error)

AssociatePlayer associates a player with the given user.

func (UsersClient) Create

func (c UsersClient) Create(ctx context.Context, req user.Create) (*user.User, error)

Create create a new user.

func (UsersClient) Get

func (c UsersClient) Get(ctx context.Context, id user.ID) (*user.User, error)

Get returns a user for the give user id.

func (UsersClient) List

func (c UsersClient) List(ctx context.Context, filter user.Filter) ([]*user.User, error)

List returns a list of users for the given item filter.

func (UsersClient) Remove

func (c UsersClient) Remove(ctx context.Context, id user.ID) error

Remove delete the given user.

func (UsersClient) Update

func (c UsersClient) Update(ctx context.Context, id user.ID, req user.Update) (*user.User, error)

Update updates an existing user.

Jump to

Keyboard shortcuts

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