iwclient

package
v0.0.0-...-cb42e1a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWorkspaceNotFound error = fmt.Errorf("workspace not found")
	ErrUnauthorized      error = fmt.Errorf("user is not authorized to read the workspace")
	ErrMoreThanOneFound  error = fmt.Errorf("more than one workspace found")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(backend client.Reader, workspacesNamespace, kubesawNamespace string) *Client

New creates a client that uses the provided backend as source

func (*Client) GetAsUser

func (c *Client) GetAsUser(
	ctx context.Context,
	user string,
	key clientinterface.SpaceKey,
	workspace *workspacesv1alpha1.InternalWorkspace,
	opts ...client.GetOption,
) error

GetAsUser retrieves the requested workspace if and only if it is community or `user` is allowed access to

func (*Client) ListAsUser

func (c *Client) ListAsUser(ctx context.Context, user string, workspaces *workspacesv1alpha1.InternalWorkspaceList) error

ListAsUser lists all the community workspaces together with the ones the user is allowed access to

func (*Client) UserHasDirectAccess

func (c *Client) UserHasDirectAccess(ctx context.Context, user, space string) (bool, error)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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