Documentation ¶
Index ¶
- Variables
- func NewApiResource(unversionedBuilder UnversionedResourceBuilder, ...) *versionedResourceBuilder
- func NewApiResourceWithStorage(unversionedBuilder UnversionedResourceBuilder, ...) *versionedResourceBuilder
- type APIGroupBuilder
- func (g *APIGroupBuilder) AddToScheme(scheme *runtime.Scheme) error
- func (g *APIGroupBuilder) Build(optionsGetter generic.RESTOptionsGetter) *genericapiserver.APIGroupInfo
- func (g *APIGroupBuilder) GetLegacyCodec() []schema.GroupVersion
- func (g *APIGroupBuilder) GetVersionPreferenceOrder() []string
- 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, error)
- func (DefaultStorageStrategy) GetSelectableFields(obj HasObjectMeta) fields.Set
- func (DefaultStorageStrategy) NamespaceScoped() bool
- func (DefaultStorageStrategy) ObjectNameFunc(obj runtime.Object) (string, error)
- func (DefaultStorageStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object)
- func (DefaultStorageStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)
- func (b DefaultStorageStrategy) TriggerFunc(obj runtime.Object) []storage.MatchValue
- func (DefaultStorageStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList
- func (DefaultStorageStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList
- type HasObjectMeta
- type HasObjectMetaSpecStatus
- type HasSpec
- type HasStatus
- type NewRESTFunc
- type SchemeFns
- type StandardStorageProvider
- type StorageBuilder
- type StorageWrapper
- type StorageWrapperWithShortcuts
- type UnVersionedApiBuilder
- type UnversionedResourceBuilder
- func NewBuilder(name, kind, path string, new, newList func() runtime.Object, ...) UnversionedResourceBuilder
- func NewBuilderWithShortcuts(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 NewInternalResourceWithShortcuts(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) GetCategories() []string
- func (b *UnversionedResourceBuilderImpl) GetKind() string
- func (b *UnversionedResourceBuilderImpl) GetName() string
- func (b *UnversionedResourceBuilderImpl) GetPath() string
- func (b *UnversionedResourceBuilderImpl) GetShortNames() []string
- func (b *UnversionedResourceBuilderImpl) New() runtime.Object
- func (b *UnversionedResourceBuilderImpl) NewList() runtime.Object
- func (b *UnversionedResourceBuilderImpl) ShouldUseRegistryStore() bool
- type VersionedApiBuilder
- type WithCategories
- type WithList
- type WithShortNames
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 ParameterCodec = runtime.NewParameterCodec(ParameterScheme)
ParameterCodec is a codec for decoding parameters
var ParameterScheme = runtime.NewScheme()
ParameterScheme is a scheme dedicated for registering parameters
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{}
Deprecated
var StatusStorageStrategySingleton = DefaultStatusStorageStrategy{StorageStrategySingleton}
var StorageStrategySingleton = DefaultStorageStrategy{ Scheme, names.SimpleNameGenerator, }
Functions ¶
func NewApiResource ¶
func NewApiResource( unversionedBuilder UnversionedResourceBuilder, 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, new, newList func() runtime.Object, RESTFunc NewRESTFunc) *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) AddToScheme ¶
func (g *APIGroupBuilder) AddToScheme(scheme *runtime.Scheme) error
Deprecated
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) 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 { }
Deprecated
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 context.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 context.Context, obj runtime.Object)
func (DefaultStorageStrategy) PrepareForUpdate ¶
func (DefaultStorageStrategy) PrepareForUpdate(ctx context.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 NewRESTFunc ¶ added in v1.12.3
type NewRESTFunc func(getter generic.RESTOptionsGetter) rest.Storage
type SchemeFns ¶
type SchemeFns interface { DefaultingFunction(obj interface{}) GetConversionFunctions() []interface{} Register(scheme *runtime.Scheme) error FieldSelectorConversion(label, value string) (string, string, error) }
Deprecated
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 context.Context, obj runtime.Object) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) Validate(ctx context.Context, obj runtime.Object) field.ErrorList ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) TriggerFunc(obj runtime.Object) []storage.MatchValue GetSelectableFields(obj HasObjectMeta) fields.Set BasicMatch(label labels.Selector, field fields.Selector) storage.SelectionPredicate }
type StorageWrapper ¶
func (StorageWrapper) Create ¶
func (s StorageWrapper) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)
type StorageWrapperWithShortcuts ¶ added in v1.12.4
type StorageWrapperWithShortcuts struct { *StorageWrapper // contains filtered or unexported fields }
func (*StorageWrapperWithShortcuts) Categories ¶ added in v1.12.4
func (b *StorageWrapperWithShortcuts) Categories() []string
func (*StorageWrapperWithShortcuts) ShortNames ¶ added in v1.12.4
func (b *StorageWrapperWithShortcuts) ShortNames() []string
type UnVersionedApiBuilder ¶
type UnVersionedApiBuilder struct { Kinds []UnversionedResourceBuilder GroupVersion schema.GroupVersion SchemeBuilder 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 WithShortNames WithCategories 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 NewBuilderWithShortcuts ¶ added in v1.12.4
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 NewInternalResourceWithShortcuts ¶ added in v1.12.4
func NewInternalResourceWithShortcuts(name, kind string, new, newList func() runtime.Object, shortnames, categories []string) UnversionedResourceBuilder
NewInternalResourceWithShortcuts creates a new strategy for a resource with shortnames and categories 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{} } shortnames - shortnames of the resource - e.g. "deploy" categories - categories of the resource - e.g. "aggregation"
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 ShortNames []string Categories []string }
func (*UnversionedResourceBuilderImpl) GetCategories ¶ added in v1.12.4
func (b *UnversionedResourceBuilderImpl) GetCategories() []string
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) GetShortNames ¶ added in v1.12.4
func (b *UnversionedResourceBuilderImpl) GetShortNames() []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 SchemeBuilder runtime.SchemeBuilder // Deprecated: Only for compiliation backward-compatibility w/ 1.12+ version generators // removing in the future 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
type WithCategories ¶ added in v1.12.4
type WithCategories interface { //AddCategory(category string) GetCategories() []string }
type WithShortNames ¶ added in v1.12.4
type WithShortNames interface { //AddShortName(shortName string) GetShortNames() []string }