Documentation ¶
Index ¶
- Variables
- type DeletionHandler
- type ID
- type Manager
- func (m *Manager) Create(ctx context.Context, app *apps.Instance, name Name) (*Namespace, error)
- func (m *Manager) Delete(ctx context.Context, app *apps.Instance, name Name) error
- func (m *Manager) GetActive(ctx context.Context, app *apps.Instance) (*Namespace, error)
- func (m *Manager) GetByID(ctx context.Context, app *apps.Instance, id ID) (*Namespace, error)
- func (m *Manager) GetByName(ctx context.Context, app *apps.Instance, name Name) (*Namespace, error)
- func (m *Manager) List(ctx context.Context, app *apps.Instance) ([]*Namespace, error)
- func (mgr *Manager) RegisterDeletionHandler(h DeletionHandler)
- func (m *Manager) Switch(ctx context.Context, app *apps.Instance, name Name) (*Namespace, error)
- type Name
- type Namespace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("namespace not found") ErrActive = errors.New("namespace is active") )
Functions ¶
This section is empty.
Types ¶
type DeletionHandler ¶
type DeletionHandler interface { // CanDeleteNamespace is called to determine whether the namespace can be deleted // by the component. To signal the namespace cannot be deleted, return a non-nil error. CanDeleteNamespace(ctx context.Context, app *apps.Instance, ns *Namespace) error // DeleteNamespace is called when a namespace is deleted. // Due to the non-atomic nature of many components, failure to handle // the deletion cannot be fully rolled back. DeleteNamespace(ctx context.Context, app *apps.Instance, ns *Namespace) error }
DeletionHandler is the interface for components that want to listen for and handle namespace deletion events.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages namespaces.
func NewManager ¶
func (*Manager) RegisterDeletionHandler ¶
func (mgr *Manager) RegisterDeletionHandler(h DeletionHandler)
Click to show internal directories.
Click to hide internal directories.