tenant

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package tenant provides Registry interface and it's REST implementation for storing Tenant api objects.

Index

Constants

This section is empty.

Variables

View Source
var StatusStrategy = tenantStatusStrategy{Strategy}
View Source
var Strategy = tenantStrategy{api.Scheme, api.SimpleNameGenerator}

Strategy is the default logic that applies when creating and updating Tenant objects via the REST API.

Functions

func MatchTenant

func MatchTenant(label labels.Selector, field fields.Selector) generic.Matcher

MatchTenant returns a generic matcher for a given label and field selector.

func TenantToSelectableFields

func TenantToSelectableFields(tenant *api.Tenant) labels.Set

TenantToSelectableFields returns a label set that represents the object

Types

type Registry

type Registry interface {
	// ListTenants obtains a list of tenants having labels which match selector.
	ListTenants(ctx api.Context, selector labels.Selector) (*api.TenantList, error)
	// Watch for new/changed/deleted tenants
	WatchTenants(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
	// Get a specific tenant
	GetTenant(ctx api.Context, tenantID string) (*api.Tenant, error)
	// Create a tenant based on a specification.
	CreateTenant(ctx api.Context, tenant *api.Tenant) error
	// Update an existing tenant
	UpdateTenant(ctx api.Context, tenant *api.Tenant) error
	// Delete an existing tenant
	DeleteTenant(ctx api.Context, tenantID string) error
}

Registry is an interface implemented by things that know how to store Tenant objects.

func NewRegistry

func NewRegistry(s rest.StandardStorage) Registry

NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳