Documentation ¶
Index ¶
- func IsValidName(name string) bool
- type Builder
- type Name
- type Names
- type Schema
- type Schemas
- func (s Schemas) Add(toAdd ...Schema) Schemas
- func (s Schemas) All() []Schema
- func (s Schemas) CollectionNames() Names
- func (s Schemas) Equal(o Schemas) bool
- func (s Schemas) Find(collection string) (Schema, bool)
- func (s Schemas) FindByGroupVersionKind(gvk config.GroupVersionKind) (Schema, bool)
- func (s Schemas) FindByGroupVersionResource(gvr schema.GroupVersionResource) (Schema, bool)
- func (s Schemas) FindByPlural(group, version, plural string) (Schema, bool)
- func (s Schemas) ForEach(handleSchema func(Schema) (done bool))
- func (s Schemas) Intersect(otherSchemas Schemas) Schemas
- func (s Schemas) Kinds() []string
- func (s Schemas) MustFind(collection string) Schema
- func (s Schemas) MustFindByGroupVersionKind(gvk config.GroupVersionKind) Schema
- func (s Schemas) Remove(toRemove ...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 ¶
func IsValidName ¶
IsValidName returns true if the given collection is a valid name.
Types ¶
type Name ¶
type Name string
Name of a collection.
type Schema ¶
type Schema interface { fmt.Stringer // Name of the collection. Name() Name // 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) CollectionNames ¶
CollectionNames returns all known collections.
func (Schemas) FindByGroupVersionKind ¶
func (s Schemas) FindByGroupVersionKind(gvk config.GroupVersionKind) (Schema, bool)
FindByGroupVersionKind searches and returns the first schema with the given GVK
func (Schemas) FindByGroupVersionResource ¶
func (s Schemas) FindByGroupVersionResource(gvr schema.GroupVersionResource) (Schema, bool)
FindByGroupVersionResource searches and returns the first schema with the given GVR
func (Schemas) FindByPlural ¶
FindByPlural searches and returns the first schema with the given Group, Version and plural form of the Kind
func (Schemas) ForEach ¶
ForEach executes the given function on each contained schema, until the function returns true.
func (Schemas) MustFindByGroupVersionKind ¶
func (s Schemas) MustFindByGroupVersionKind(gvk config.GroupVersionKind) Schema
MustFindByGroupVersionKind calls FindByGroupVersionKind and panics if not found.
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 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 Schema) *SchemasBuilder
MustAdd calls Add and panics if it fails.