Documentation
¶
Index ¶
- Variables
- func NewApiResource(unversionedBuilder UnversionedResourceBuilder, schemeFns SchemeFns, ...) *versionedResourceBuilder
- func NewApiResourceWithStorage(unversionedBuilder UnversionedResourceBuilder, schemeFns SchemeFns, ...) *versionedResourceBuilder
- type APIGroupBuilder
- func (g *APIGroupBuilder) Announce()
- func (g *APIGroupBuilder) Build(optionsGetter generic.RESTOptionsGetter) *genericapiserver.APIGroupInfo
- func (g *APIGroupBuilder) GetLegacyCodec() []schema.GroupVersion
- func (g *APIGroupBuilder) GetVersionPreferenceOrder() []string
- func (g *APIGroupBuilder) Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, ...)
- func (g *APIGroupBuilder) VersionToSchemeFunc() announced.VersionToSchemeFunc
- func (g *APIGroupBuilder) WithRootScopedKinds(kinds ...string) *APIGroupBuilder
- func (g *APIGroupBuilder) WithUnVersionedApi(unversioned *UnVersionedApiBuilder) *APIGroupBuilder
- func (g *APIGroupBuilder) WithVersionedApis(versions ...*VersionedApiBuilder) *APIGroupBuilder
- type Controller
- type ControllerArgs
- type DefaultControllerFns
- type DefaultSchemeFns
- type DefaultStatusStorageStrategy
- type DefaultStorageStrategy
- func (DefaultStorageStrategy) AllowCreateOnUpdate() bool
- func (DefaultStorageStrategy) AllowUnconditionalUpdate() bool
- func (b DefaultStorageStrategy) BasicMatch(label labels.Selector, field fields.Selector) storage.SelectionPredicate
- func (DefaultStorageStrategy) Build(builder StorageBuilder, store *StorageWrapper, options *generic.StoreOptions)
- func (DefaultStorageStrategy) Canonicalize(obj runtime.Object)
- func (b DefaultStorageStrategy) GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error)
- func (DefaultStorageStrategy) GetSelectableFields(obj HasObjectMeta) fields.Set
- func (DefaultStorageStrategy) NamespaceScoped() bool
- func (DefaultStorageStrategy) ObjectNameFunc(obj runtime.Object) (string, error)
- func (DefaultStorageStrategy) PrepareForCreate(ctx request.Context, obj runtime.Object)
- func (DefaultStorageStrategy) PrepareForUpdate(ctx request.Context, obj, old runtime.Object)
- func (b DefaultStorageStrategy) TriggerFunc(obj runtime.Object) []storage.MatchValue
- func (DefaultStorageStrategy) Validate(ctx request.Context, obj runtime.Object) field.ErrorList
- func (DefaultStorageStrategy) ValidateUpdate(ctx request.Context, obj, old runtime.Object) field.ErrorList
- type HasObjectMeta
- type HasObjectMetaSpecStatus
- type HasSpec
- type HasStatus
- type SchemeFns
- type StandardStorageProvider
- type StorageBuilder
- type StorageWrapper
- type UnVersionedApiBuilder
- type UnversionedResourceBuilder
- func NewBuilder(name, kind, path string, new, newList func() runtime.Object, ...) UnversionedResourceBuilder
- func NewInternalResource(name, kind string, new, newList func() runtime.Object) UnversionedResourceBuilder
- func NewInternalResourceStatus(name, kind string, new, newList func() runtime.Object) UnversionedResourceBuilder
- func NewInternalSubresource(name, kind, path string, new func() runtime.Object) UnversionedResourceBuilder
- type UnversionedResourceBuilderImpl
- func (b *UnversionedResourceBuilderImpl) GetKind() string
- func (b *UnversionedResourceBuilderImpl) GetName() string
- func (b *UnversionedResourceBuilderImpl) GetPath() string
- func (b *UnversionedResourceBuilderImpl) New() runtime.Object
- func (b *UnversionedResourceBuilderImpl) NewList() runtime.Object
- func (b *UnversionedResourceBuilderImpl) ShouldUseRegistryStore() bool
- type VersionedApiBuilder
- type WithList
Constants ¶
This section is empty.
Variables ¶
var APIGroupBuilders = []*APIGroupBuilder{}
Global registry of API groups
var Codecs = serializer.NewCodecFactory(Scheme)
Codecs provides access to encoding and decoding for the scheme
var GroupFactoryRegistry = make(announced.APIGroupFactoryRegistry)
GroupFactoryRegistry is the APIGroupFactoryRegistry (overlaps a bit with Registry, see comments in package for details)
var Registry = registered.NewOrDie(os.Getenv("KUBE_API_VERSIONS"))
Registry is an instance of an API registry. This is an interim step to start removing the idea of a global API registry.
var Scheme = runtime.NewScheme()
Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered.
var SchemeFnsSingleton = DefaultSchemeFns{}
var StatusStorageStrategySingleton = DefaultStatusStorageStrategy{StorageStrategySingleton}
var StorageStrategySingleton = DefaultStorageStrategy{ Scheme, names.SimpleNameGenerator, }
Functions ¶
func NewApiResource ¶
func NewApiResource( unversionedBuilder UnversionedResourceBuilder, schemeFns SchemeFns, new, newList func() runtime.Object, storeBuilder StorageBuilder) *versionedResourceBuilder
NewApiResource returns a new versionedResourceBuilder for registering endpoints for resources that are persisted to storage. strategy - unversionedBuilder from calling NewUnversionedXXX() new - function for creating new empty VERSIONED instances - e.g. func() runtime.Object { return &Deployment{} } newList - function for creating an empty list of VERSIONED instances - e.g. func() runtime.Object { return &DeploymentList{} } storeBuilder - builder for creating the store
func NewApiResourceWithStorage ¶
func NewApiResourceWithStorage( unversionedBuilder UnversionedResourceBuilder, schemeFns SchemeFns, new, newList func() runtime.Object, RESTFunc func() rest.Storage) *versionedResourceBuilder
NewApiResourceWithStorage returns a new versionedResourceBuilder for registering endpoints that does not require standard storage (e.g. subresources reuses the storage for the parent resource). strategy - unversionedBuilder from calling NewUnversionedXXX() new - function for creating new empty VERSIONED instances - e.g. func() runtime.Object { return &Deployment{} } storage - storage for manipulating the resource
Types ¶
type APIGroupBuilder ¶
type APIGroupBuilder struct {
UnVersioned *UnVersionedApiBuilder
Versions []*VersionedApiBuilder
Name string
ImportPrefix string
RootScopedKinds []string
}
func NewApiGroupBuilder ¶
func NewApiGroupBuilder(name, prefix string) *APIGroupBuilder
func (*APIGroupBuilder) Announce ¶
func (g *APIGroupBuilder) Announce()
Announce installs the API group for an api server
func (*APIGroupBuilder) Build ¶
func (g *APIGroupBuilder) Build(optionsGetter generic.RESTOptionsGetter) *genericapiserver.APIGroupInfo
Build returns a new NewDefaultAPIGroupInfo to install into a GenericApiServer
func (*APIGroupBuilder) GetLegacyCodec ¶
func (g *APIGroupBuilder) GetLegacyCodec() []schema.GroupVersion
func (*APIGroupBuilder) GetVersionPreferenceOrder ¶
func (g *APIGroupBuilder) GetVersionPreferenceOrder() []string
GetVersionPreferenceOrder returns the preferred ordering of versions for this api group
func (*APIGroupBuilder) Install ¶
func (g *APIGroupBuilder) Install( groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme)
func (*APIGroupBuilder) VersionToSchemeFunc ¶
func (g *APIGroupBuilder) VersionToSchemeFunc() announced.VersionToSchemeFunc
VersionToSchemeFunc returns a map of version to AddToScheme function for all versioned Schemes
func (*APIGroupBuilder) WithRootScopedKinds ¶
func (g *APIGroupBuilder) WithRootScopedKinds(kinds ...string) *APIGroupBuilder
func (*APIGroupBuilder) WithUnVersionedApi ¶
func (g *APIGroupBuilder) WithUnVersionedApi(unversioned *UnVersionedApiBuilder) *APIGroupBuilder
func (*APIGroupBuilder) WithVersionedApis ¶
func (g *APIGroupBuilder) WithVersionedApis(versions ...*VersionedApiBuilder) *APIGroupBuilder
type Controller ¶
type Controller interface {
}
type ControllerArgs ¶
type ControllerArgs interface {
}
type DefaultControllerFns ¶
type DefaultControllerFns struct {
}
func (DefaultControllerFns) Run ¶
func (DefaultControllerFns) Run(stopCh <-chan struct{})
type DefaultSchemeFns ¶
type DefaultSchemeFns struct {
}
func (DefaultSchemeFns) DefaultingFunction ¶
func (DefaultSchemeFns) DefaultingFunction(interface{})
func (DefaultSchemeFns) FieldSelectorConversion ¶
func (DefaultSchemeFns) FieldSelectorConversion(label, value string) (string, string, error)
func (DefaultSchemeFns) GetConversionFunctions ¶
func (DefaultSchemeFns) GetConversionFunctions() []interface{}
type DefaultStatusStorageStrategy ¶
type DefaultStatusStorageStrategy struct {
DefaultStorageStrategy
}
func (DefaultStatusStorageStrategy) PrepareForUpdate ¶
func (DefaultStatusStorageStrategy) PrepareForUpdate(ctx request.Context, obj, old runtime.Object)
type DefaultStorageStrategy ¶
type DefaultStorageStrategy struct {
runtime.ObjectTyper
names.NameGenerator
}
func (DefaultStorageStrategy) AllowCreateOnUpdate ¶
func (DefaultStorageStrategy) AllowCreateOnUpdate() bool
func (DefaultStorageStrategy) AllowUnconditionalUpdate ¶
func (DefaultStorageStrategy) AllowUnconditionalUpdate() bool
func (DefaultStorageStrategy) BasicMatch ¶
func (b DefaultStorageStrategy) BasicMatch(label labels.Selector, field fields.Selector) storage.SelectionPredicate
MatchResource is the filter used by the generic etcd backend to watch events from etcd to clients of the apiserver only interested in specific labels/fields.
func (DefaultStorageStrategy) Build ¶
func (DefaultStorageStrategy) Build(builder StorageBuilder, store *StorageWrapper, options *generic.StoreOptions)
Build sets the strategy for the store
func (DefaultStorageStrategy) Canonicalize ¶
func (DefaultStorageStrategy) Canonicalize(obj runtime.Object)
func (DefaultStorageStrategy) GetSelectableFields ¶
func (DefaultStorageStrategy) GetSelectableFields(obj HasObjectMeta) fields.Set
GetSelectableFields returns a field set that represents the object.
func (DefaultStorageStrategy) NamespaceScoped ¶
func (DefaultStorageStrategy) NamespaceScoped() bool
func (DefaultStorageStrategy) ObjectNameFunc ¶
func (DefaultStorageStrategy) ObjectNameFunc(obj runtime.Object) (string, error)
func (DefaultStorageStrategy) PrepareForCreate ¶
func (DefaultStorageStrategy) PrepareForCreate(ctx request.Context, obj runtime.Object)
func (DefaultStorageStrategy) PrepareForUpdate ¶
func (DefaultStorageStrategy) PrepareForUpdate(ctx request.Context, obj, old runtime.Object)
func (DefaultStorageStrategy) TriggerFunc ¶
func (b DefaultStorageStrategy) TriggerFunc(obj runtime.Object) []storage.MatchValue
func (DefaultStorageStrategy) ValidateUpdate ¶
type HasObjectMeta ¶
type HasObjectMeta interface {
GetObjectMeta() *metav1.ObjectMeta
}
type HasObjectMetaSpecStatus ¶
type HasObjectMetaSpecStatus interface {
HasObjectMeta
HasSpec
HasStatus
}
type HasStatus ¶
type HasStatus interface {
NewStatus() interface{}
GetStatus() interface{}
SetStatus(status interface{})
}
type StandardStorageProvider ¶
type StandardStorageProvider interface {
GetStandardStorage() rest.StandardStorage
}
type StorageBuilder ¶
type StorageBuilder interface {
Build(builder StorageBuilder, store *StorageWrapper, options *generic.StoreOptions)
names.NameGenerator
runtime.ObjectTyper
ObjectNameFunc(obj runtime.Object) (string, error)
NamespaceScoped() bool
AllowCreateOnUpdate() bool
AllowUnconditionalUpdate() bool
Canonicalize(obj runtime.Object)
PrepareForCreate(ctx request.Context, obj runtime.Object)
PrepareForUpdate(ctx request.Context, obj, old runtime.Object)
Validate(ctx request.Context, obj runtime.Object) field.ErrorList
ValidateUpdate(ctx request.Context, obj, old runtime.Object) field.ErrorList
GetAttrs(obj runtime.Object) (labels.Set, fields.Set, bool, error)
TriggerFunc(obj runtime.Object) []storage.MatchValue
GetSelectableFields(obj HasObjectMeta) fields.Set
BasicMatch(label labels.Selector, field fields.Selector) storage.SelectionPredicate
}
type StorageWrapper ¶
type UnVersionedApiBuilder ¶
type UnVersionedApiBuilder struct {
Kinds []UnversionedResourceBuilder
GroupVersion schema.GroupVersion
SchemaBuilder runtime.SchemeBuilder
}
func NewApiGroup ¶
func NewApiGroup(group string) *UnVersionedApiBuilder
func (*UnVersionedApiBuilder) WithKinds ¶
func (s *UnVersionedApiBuilder) WithKinds(kinds ...UnversionedResourceBuilder) *UnVersionedApiBuilder
type UnversionedResourceBuilder ¶
type UnversionedResourceBuilder interface {
WithList
New() runtime.Object
GetPath() string
GetName() string
GetKind() string
ShouldUseRegistryStore() bool
}
func NewBuilder ¶
func NewBuilder( name, kind, path string, new, newList func() runtime.Object, useRegistryStore bool) UnversionedResourceBuilder
func NewInternalResource ¶
func NewInternalResource(name, kind string, new, newList func() runtime.Object) UnversionedResourceBuilder
NewInternalResource creates a new strategy for a resource name - name of the resource - e.g. "deployments" new - function for creating new empty UNVERSIONED instances - e.g. func() runtime.Object { return &Deployment{} } newList - function for creating an empty list of UNVERSIONED instances - e.g. func() runtime.Object { return &DeploymentList{} }
func NewInternalResourceStatus ¶
func NewInternalResourceStatus(name, kind string, new, newList func() runtime.Object) UnversionedResourceBuilder
NewInternalResourceStatus returns a new strategy for the status subresource of an object name - name of the resource - e.g. "deployments" new - function for creating new empty UNVERSIONED instances - e.g. func() runtime.Object { return &Deployment{} } newList - function for creating an empty list of UNVERSIONED instances - e.g. func() runtime.Object { return &DeploymentList{} }
func NewInternalSubresource ¶
func NewInternalSubresource(name, kind, path string, new func() runtime.Object) UnversionedResourceBuilder
NewInternalSubresource returns a new strategy for a subresource name - name of the resource - e.g. "deployments" path - path to the subresource - e.g. "scale" new - function for creating new empty UNVERSIONED instances - e.g. func() runtime.Object { return &Deployment{} }
type UnversionedResourceBuilderImpl ¶
type UnversionedResourceBuilderImpl struct {
Path string
Name string
Kind string
NewFunc func() runtime.Object
NewListFunc func() runtime.Object
UseRegistryStore bool
}
func (*UnversionedResourceBuilderImpl) GetKind ¶
func (b *UnversionedResourceBuilderImpl) GetKind() string
func (*UnversionedResourceBuilderImpl) GetName ¶
func (b *UnversionedResourceBuilderImpl) GetName() string
func (*UnversionedResourceBuilderImpl) GetPath ¶
func (b *UnversionedResourceBuilderImpl) GetPath() string
func (*UnversionedResourceBuilderImpl) New ¶
func (b *UnversionedResourceBuilderImpl) New() runtime.Object
func (*UnversionedResourceBuilderImpl) NewList ¶
func (b *UnversionedResourceBuilderImpl) NewList() runtime.Object
func (*UnversionedResourceBuilderImpl) ShouldUseRegistryStore ¶
func (b *UnversionedResourceBuilderImpl) ShouldUseRegistryStore() bool
type VersionedApiBuilder ¶
type VersionedApiBuilder struct {
Kinds []*versionedResourceBuilder
GroupVersion schema.GroupVersion
SchemaBuilder runtime.SchemeBuilder
}
func NewApiVersion ¶
func NewApiVersion(group, version string) *VersionedApiBuilder
func (*VersionedApiBuilder) WithResources ¶
func (s *VersionedApiBuilder) WithResources(resourceBuilders ...*versionedResourceBuilder) *VersionedApiBuilder
WithResources adds new resource types and subresources to the API versions resourceBuilders is a list of *versionedResourceBuilder