Help us shape the future of Go! Take the 2026 Go Developer Survey

project

package
v0.3.61 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 12 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")
)

Functions

func NameFromContext

func NameFromContext(ctx context.Context) (string, error)

NameFromContext translates an Openstack project ID to one we an use.

Types

type Client

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

Client wraps up project related management handling.

func NewClient

func NewClient(client client.Client) *Client

NewClient returns a new client with required parameters.

func (*Client) Create

func (c *Client) Create(ctx context.Context) error

Create creates the implicit project indentified by the JTW claims.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context) error

Delete deletes the implicit project indentified by the JTW claims.

func (*Client) GetMetadata

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

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

func (*Client) GetOrCreateMetadata

func (c *Client) GetOrCreateMetadata(ctx context.Context) (*Meta, error)

type Meta

type Meta struct {
	// 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.

Jump to

Keyboard shortcuts

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