kosmo

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsAlreadyExists     = &KosmoError{}
	ErrNotFound            = &KosmoError{}
	ErrBadRequest          = &KosmoError{}
	ErrForbidden           = &KosmoError{}
	ErrUnauthorized        = &KosmoError{}
	ErrInternalServerError = &KosmoError{}
	ErrServiceUnavailable  = &KosmoError{}
)
View Source
var (
	ErrNoItems = errors.New("no items")
)

Functions

func NewBadRequestError added in v0.5.0

func NewBadRequestError(message string, err error) error

func NewForbiddenError added in v0.5.0

func NewForbiddenError(message string, err error) error

func NewInternalServerError added in v0.5.0

func NewInternalServerError(message string, err error) error

func NewIsAlreadyExistsError added in v0.5.0

func NewIsAlreadyExistsError(message string, err error) error

func NewNotFoundError added in v0.5.0

func NewNotFoundError(message string, err error) error

func NewServiceUnavailableError added in v0.5.0

func NewServiceUnavailableError(message string, err error) error

func NewUnauthorizedError added in v0.5.0

func NewUnauthorizedError(message string, err error) error

Types

type Client

type Client struct {
	client.Client
}

func NewClient

func NewClient(c client.Client) Client

func NewClientByRestConfig

func NewClientByRestConfig(cfg *rest.Config, scheme *runtime.Scheme) (Client, error)

func (*Client) AddNetworkRule added in v0.5.0

func (c *Client) AddNetworkRule(ctx context.Context, name, username string, r cosmov1alpha1.NetworkRule, index int) (*cosmov1alpha1.NetworkRule, error)

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, username string, displayName string,
	roles []string, authType string, addons []cosmov1alpha1.UserAddon) (*cosmov1alpha1.User, error)

func (*Client) CreateWorkspace added in v0.5.0

func (c *Client) CreateWorkspace(ctx context.Context, username, wsName, tmplName string, vars map[string]string, opts ...client.CreateOption) (*cosmov1alpha1.Workspace, error)

func (*Client) DeleteNetworkRule added in v0.5.0

func (c *Client) DeleteNetworkRule(ctx context.Context, name, username string, index int) (*cosmov1alpha1.NetworkRule, error)

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, username string) (*cosmov1alpha1.User, error)

func (*Client) DeleteWorkspace added in v0.5.0

func (c *Client) DeleteWorkspace(ctx context.Context, name, username string, opts ...client.DeleteOption) (*cosmov1alpha1.Workspace, error)

func (*Client) GetDefaultPassword

func (c *Client) GetDefaultPassword(ctx context.Context, username string) (*string, error)

func (*Client) GetDefaultPasswordAwait added in v0.5.0

func (c *Client) GetDefaultPasswordAwait(ctx context.Context, username string) (*string, error)

func (*Client) GetTemplate

func (c *Client) GetTemplate(ctx context.Context, tmplName string) (*cosmov1alpha1.Template, error)

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, name string) (*cosmov1alpha1.User, error)

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(ctx context.Context, name, namespace string) (*cosmov1alpha1.Workspace, error)

func (*Client) GetWorkspaceByUserName added in v0.8.0

func (c *Client) GetWorkspaceByUserName(ctx context.Context, name, username string) (*cosmov1alpha1.Workspace, error)

func (*Client) GetWorkspaceConfig

func (c *Client) GetWorkspaceConfig(ctx context.Context, tmplName string) (cfg cosmov1alpha1.Config, err error)

func (*Client) IsDefaultPassword

func (c *Client) IsDefaultPassword(ctx context.Context, username string) (bool, error)

func (*Client) ListUserAddonTemplates added in v0.5.0

func (c *Client) ListUserAddonTemplates(ctx context.Context, roles []cosmov1alpha1.UserRole) ([]cosmov1alpha1.TemplateObject, error)

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context) ([]cosmov1alpha1.User, error)

func (*Client) ListWorkspaceTemplates added in v0.5.0

func (c *Client) ListWorkspaceTemplates(ctx context.Context, roles []cosmov1alpha1.UserRole) ([]cosmov1alpha1.TemplateObject, error)

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces(ctx context.Context, namespace string) ([]cosmov1alpha1.Workspace, error)

func (*Client) ListWorkspacesByUserName added in v0.8.0

func (c *Client) ListWorkspacesByUserName(ctx context.Context, username string) ([]cosmov1alpha1.Workspace, error)

func (*Client) RegisterPassword

func (c *Client) RegisterPassword(ctx context.Context, username string, passwd []byte) error

func (*Client) ResetPassword

func (c *Client) ResetPassword(ctx context.Context, username string) error

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, username string, opts UpdateUserOpts) (*cosmov1alpha1.User, error)

func (*Client) UpdateWorkspace added in v0.5.0

func (c *Client) UpdateWorkspace(ctx context.Context, name, username string, opts UpdateWorkspaceOpts) (*cosmov1alpha1.Workspace, error)

func (*Client) VerifyPassword

func (c *Client) VerifyPassword(ctx context.Context, username string, pass []byte) (verified bool, isDefault bool, err error)

type KosmoError added in v0.5.0

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

func (*KosmoError) Error added in v0.5.0

func (e *KosmoError) Error() string

func (*KosmoError) Is added in v0.5.0

func (e *KosmoError) Is(target error) bool

func (*KosmoError) Unwrap added in v0.5.0

func (e *KosmoError) Unwrap() error

type UpdateUserOpts added in v0.5.0

type UpdateUserOpts struct {
	DisplayName *string
	UserRoles   []string
}

type UpdateWorkspaceOpts added in v0.5.0

type UpdateWorkspaceOpts struct {
	Replicas *int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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