projects

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrResourceDeleting is raised when the resource is being deleted.
	ErrResourceDeleting = goerrors.New("resource is being deleted")

	// ErrNamespaceUnset is raised when the namespace hasn't been created
	// yet.
	ErrNamespaceUnset = goerrors.New("resource namespace is unset")
)
View Source
var (
	ErrNoScope = errors.New("nothing in scope")
)

Functions

This section is empty.

Types

type Client

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

Client wraps up project related management handling.

func New

func New(client client.Client, namespace string) *Client

New returns a new client with required parameters.

func (*Client) Create

func (c *Client) Create(ctx context.Context, organizationName string, request *generated.ProjectSpec) error

Create creates the implicit project indentified by the JTW claims.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, organizationName, name string) error

Delete deletes the project.

func (*Client) Get added in v0.2.4

func (c *Client) Get(ctx context.Context, organizationName, name string) (*generated.Project, error)

func (*Client) GetMetadata

func (c *Client) GetMetadata(ctx context.Context, organizationName, name string) (*Meta, error)

GetMetadata retrieves the project metadata. Clients should consult at least the Active status before doing anything with the project.

func (*Client) List

func (c *Client) List(ctx context.Context, organizationName string) (generated.Projects, error)

func (*Client) Update added in v0.2.4

func (c *Client) Update(ctx context.Context, organizationName, name string, request *generated.ProjectSpec) error

type Meta

type Meta struct {
	// Organization is the owning organization;s metadata.
	Organization *organizations.Meta

	// Name is the project's Kubernetes name, so a higher level resource
	// can reference it.
	Name string

	// Namespace is the namespace that is provisioned by the project.
	// Should be usable set when the project is active.
	Namespace string

	// Deleting tells us if we should allow new child objects to be created
	// in this resource's namespace.
	Deleting bool
}

Meta describes the project.

type Scoper

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

func NewScoper

func NewScoper(ctx context.Context, client client.Client, organization string) *Scoper

func (*Scoper) ListProjects

func (s *Scoper) ListProjects(ctx context.Context) (*unikornv1.ProjectList, error)

func (*Scoper) MustApplyScope

func (s *Scoper) MustApplyScope() bool

Jump to

Keyboard shortcuts

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