server

package
v0.0.0-...-a8c9c8d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	EtcdOptions   etcd.Options
	CalicoOptions calico.Options

	Authorizer authorizer.Authorizer
	ShortNames []string
	// contains filtered or unexported fields
}

Options is the extension of a generic.RESTOptions struct, complete with service-catalog specific things

func NewOptions

func NewOptions(
	etcdOpts etcd.Options,
	calicoOpts calico.Options,
	sType StorageType,
	authorizer authorizer.Authorizer,
	ShortNames []string,
) *Options

NewOptions returns a new Options with the given parameters

func (Options) GetStorage

func (o Options) GetStorage(
	resourcePrefix string,
	keyFunc func(obj runtime.Object) (string, error),
	scopeStrategy rest.NamespaceScopedStrategy,
	newFunc func() runtime.Object,
	newListFunc func() runtime.Object,
	getAttrsFunc storage.AttrFunc,
	trigger storage.IndexerFuncs,
	indexers *cache.Indexers,
) (registry.DryRunnableStorage, factory.DestroyFunc, error)

GetStorage returns the storage from the given parameters

func (Options) KeyFunc

func (o Options) KeyFunc(namespaced bool) func(context.Context, string) (string, error)

KeyFunc returns the appropriate key function for the storage type in o. This function should produce a path that etcd or Calico storage understands, to the resource by combining the namespace in the context with the given prefix

func (Options) KeyRootFunc

func (o Options) KeyRootFunc(namespaced bool) func(context.Context) string

KeyRootFunc returns the appropriate key root function for the storage type in o. This function produces a path that etcd or Calico storage understands, to the root of the resource by combining the namespace in the context with the given prefix

func (Options) ResourcePrefix

func (o Options) ResourcePrefix() string

ResourcePrefix gets the resource prefix of all etcd keys

func (Options) StorageType

func (o Options) StorageType() (StorageType, error)

StorageType returns the storage type the rest server should use, or an error if an unsupported storage type is indicated

type StorageType

type StorageType string

StorageType represents the type of storage a storage interface should use

const (
	// StorageTypeCalico indicates a storage interface should use libcalico
	StorageTypeCalico StorageType = "calico"
	// StorageTypeEtcd indicates a storage interface should use default etcd
	StorageTypeEtcd StorageType = "etcd"
)

func StorageTypeFromString

func StorageTypeFromString(s string) (StorageType, error)

StorageTypeFromString converts s to a valid StorageType. Returns StorageType("") and a non-nil error if s names an invalid or unsupported storage type

func (StorageType) String

func (s StorageType) String() string

Jump to

Keyboard shortcuts

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