example

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUserNotFound sentinelError = "user not found"
	ErrUnauthorized sentinelError = "unauthorized"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(serverURL url.URL) (*Client, error)

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, userName string) (UserID, error)

func (*Client) DeleteUserByID

func (c *Client) DeleteUserByID(ctx context.Context, userID UserID) error

func (*Client) GetUserByID

func (c *Client) GetUserByID(ctx context.Context, userID UserID) (*User, error)

type User

type User struct {
	ID   UserID
	Name string
}

type UserID

type UserID uint64

func (UserID) String

func (id UserID) String() string

Jump to

Keyboard shortcuts

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