client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = Config{
		BaseURL: "http://localhost:3456",
	}
)

Functions

func WithContext

func WithContext(ctx context.Context, api *API) context.Context

Types

type API

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

func Extract

func Extract(ctx context.Context) *API

func NewAPI

func NewAPI(cfg Config) (*API, error)

func (*API) Do

func (api *API) Do(ctx context.Context, method, path string, req interface{}, res interface{}) error

func (*API) Services

func (api *API) Services() *Services

func (*API) Users

func (api *API) Users() *Users

type Config

type Config struct {
	BaseURL string                 `json:"base_url" usage:"the base url that points to a varys instance"`
	Basic   basicauth.ClientConfig `json:"basic"`
}

type CurrentUser

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

func (*CurrentUser) Get

func (u *CurrentUser) Get(ctx context.Context) (auth.UserInfo, error)

func (*CurrentUser) Update

func (u *CurrentUser) Update(ctx context.Context, update engine.UpdateUserRequest) error

type Grants

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

func (*Grants) Delete

func (a *Grants) Delete(ctx context.Context, kind, name string, grant engine.UserGrant) error

func (*Grants) List

func (a *Grants) List(ctx context.Context, kind, name string) ([]engine.UserGrant, error)

func (*Grants) Update

func (a *Grants) Update(ctx context.Context, kind, name string, grant engine.UserGrant) error

type Services

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

func (*Services) Create

func (*Services) Credentials

func (s *Services) Credentials(ctx context.Context, kind, name string) (engine.ServiceCredentials, error)

func (*Services) Delete

func (s *Services) Delete(ctx context.Context, kind, name string) error

func (*Services) Get

func (s *Services) Get(ctx context.Context, kind, name string) (engine.Service, error)

func (*Services) Grants

func (s *Services) Grants() *Grants

func (*Services) List

func (s *Services) List(ctx context.Context) ([]engine.Service, error)

func (*Services) Update

func (s *Services) Update(ctx context.Context, kind, name string, req engine.UpdateServiceRequest) error

type Users

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

func (*Users) Current

func (u *Users) Current() *CurrentUser

func (*Users) List

func (u *Users) List(ctx context.Context) ([]engine.User, error)

Jump to

Keyboard shortcuts

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