Documentation ¶
Index ¶
- type Builder
- type Schema
- type Schemas
- func (s Schemas) Add(toAdd ...resource.Schema) Schemas
- func (s Schemas) All() []resource.Schema
- func (s Schemas) Equal(o Schemas) bool
- func (s Schemas) FindByGroupKind(gvk config.GroupVersionKind) (resource.Schema, bool)
- func (s Schemas) FindByGroupVersionAliasesKind(gvk config.GroupVersionKind) (resource.Schema, bool)
- func (s Schemas) FindByGroupVersionKind(gvk config.GroupVersionKind) (resource.Schema, bool)
- func (s Schemas) FindByGroupVersionResource(gvr schema.GroupVersionResource) (resource.Schema, bool)
- func (s Schemas) ForEach(handleSchema func(resource.Schema) (done bool))
- func (s Schemas) GroupVersionKinds() []config.GroupVersionKind
- func (s Schemas) Intersect(otherSchemas Schemas) Schemas
- func (s Schemas) Kinds() []string
- func (s Schemas) Remove(toRemove ...resource.Schema) Schemas
- func (s Schemas) Union(otherSchemas Schemas) Schemas
- func (s Schemas) Validate() (err error)
- type SchemasBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema interface { fmt.Stringer // VariableName is a utility method used to help with codegen. It provides the name of a Schema instance variable. VariableName() string // Resource is the schema for resources contained in this collection. Resource() resource.Schema // Equal is a helper function for testing equality between Schema instances. This supports comparison // with the cmp library. Equal(other Schema) bool }
Schema for a collection.
type Schemas ¶
type Schemas struct {
// contains filtered or unexported fields
}
Schemas contains metadata about configuration resources.
func SchemasFor ¶
SchemasFor is a shortcut for creating Schemas. It uses MustAdd for each element.
func (Schemas) FindByGroupKind ¶
FindByGroupKind searches and returns the first schema with the given GVK, ignoring versions. Generally it's a good idea to use FindByGroupVersionAliasesKind, which validates the version as well. FindByGroupKind provides future proofing against versions we don't yet know about; given we don't know them, its risky.
func (Schemas) FindByGroupVersionAliasesKind ¶
FindByGroupVersionAliasesKind searches and returns the first schema with the given GVK, if not found, it will search for version aliases for the schema to see if there is a match.
func (Schemas) FindByGroupVersionKind ¶
FindByGroupVersionKind searches and returns the first schema with the given GVK
func (Schemas) FindByGroupVersionResource ¶
func (s Schemas) FindByGroupVersionResource(gvr schema.GroupVersionResource) (resource.Schema, bool)
FindByGroupVersionResource searches and returns the first schema with the given GVR
func (Schemas) ForEach ¶
ForEach executes the given function on each contained schema, until the function returns true.
func (Schemas) GroupVersionKinds ¶
func (s Schemas) GroupVersionKinds() []config.GroupVersionKind
GroupVersionKinds returns all known GroupVersionKinds
type SchemasBuilder ¶
type SchemasBuilder struct {
// contains filtered or unexported fields
}
SchemasBuilder is a builder for the schemas type.
func NewSchemasBuilder ¶
func NewSchemasBuilder() *SchemasBuilder
NewSchemasBuilder returns a new instance of SchemasBuilder.
func (*SchemasBuilder) Add ¶
func (b *SchemasBuilder) Add(s resource.Schema) error
Add a new collection to the schemas.
func (*SchemasBuilder) Build ¶
func (b *SchemasBuilder) Build() Schemas
Build a new schemas from this SchemasBuilder.
func (*SchemasBuilder) MustAdd ¶
func (b *SchemasBuilder) MustAdd(s resource.Schema) *SchemasBuilder
MustAdd calls Add and panics if it fails.