This section is empty.


This section is empty.


func IsValidName

func IsValidName(name string) bool

    IsValidName returns true if the given collection is a valid name.


    type Builder

    type Builder struct {
    	Name         string
    	VariableName string
    	Disabled     bool
    	Resource     resource.Schema

      Config for the creation of a Schema

      func (Builder) Build

      func (b Builder) Build() (Schema, error)

        Build a Schema instance.

        func (Builder) MustBuild

        func (b Builder) MustBuild() Schema

          MustBuild calls Build and panics if it fails.

          type Name

          type Name string

            Name of a collection.

            func NewName

            func NewName(n string) Name

              NewName returns a strongly typed collection. Panics if the name is not valid.

              func (Name) String

              func (n Name) String() string

                String interface method implementation.

                type Names

                type Names []Name

                  Names is a collection of names

                  func (Names) Clone

                  func (n Names) Clone() Names

                    Clone names

                    func (Names) Sort

                    func (n Names) Sort()

                      Sort the names in ascending order.

                      type Schema

                      type Schema interface {
                      	// 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
                      	// IsDisabled indicates whether or not this collection is disabled.
                      	IsDisabled() bool
                      	// Disable creates a disabled copy of this Schema.
                      	Disable() 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

                          func SchemasFor(schemas ...Schema) Schemas

                            SchemasFor is a shortcut for creating Schemas. It uses MustAdd for each element.

                            func (Schemas) Add

                            func (s Schemas) Add(toAdd ...Schema) Schemas

                              Add creates a copy of this Schemas with the given schemas added.

                              func (Schemas) All

                              func (s Schemas) All() []Schema

                                All returns all known Schemas

                                func (Schemas) CollectionNames

                                func (s Schemas) CollectionNames() Names

                                  CollectionNames returns all known collections.

                                  func (Schemas) DisabledCollectionNames

                                  func (s Schemas) DisabledCollectionNames() Names

                                    DisabledCollectionNames returns the names of disabled collections

                                    func (Schemas) Equal

                                    func (s Schemas) Equal(o Schemas) bool

                                    func (Schemas) Find

                                    func (s Schemas) Find(collection string) (Schema, bool)

                                      Find looks up a Schema by its collection name.

                                      func (Schemas) FindByGroupVersionKind

                                      func (s Schemas) FindByGroupVersionKind(gvk config.GroupVersionKind) (Schema, bool)

                                        FindByKind searches and returns the first schema with the given kind

                                        func (Schemas) FindByGroupVersionResource

                                        func (s Schemas) FindByGroupVersionResource(gvr schema.GroupVersionResource) (Schema, bool)

                                          FindByKind searches and returns the first schema with the given kind

                                          func (Schemas) FindByPlural

                                          func (s Schemas) FindByPlural(group, version, plural string) (Schema, bool)

                                            FindByKind searches and returns the first schema with the given kind

                                            func (Schemas) ForEach

                                            func (s Schemas) ForEach(handleSchema func(Schema) (done bool))

                                              ForEach executes the given function on each contained schema, until the function returns true.

                                              func (Schemas) Kinds

                                              func (s Schemas) Kinds() []string

                                                Kinds returns all known resource kinds.

                                                func (Schemas) MustFind

                                                func (s Schemas) MustFind(collection string) Schema

                                                  MustFind calls Find and panics if not found.

                                                  func (Schemas) MustFindByGroupVersionKind

                                                  func (s Schemas) MustFindByGroupVersionKind(gvk config.GroupVersionKind) Schema

                                                    MustFind calls FindByGroupVersionKind and panics if not found.

                                                    func (Schemas) Remove

                                                    func (s Schemas) Remove(toRemove ...Schema) Schemas

                                                      Remove creates a copy of this Schemas with the given schemas removed.

                                                      func (Schemas) Validate

                                                      func (s Schemas) Validate() (err error)

                                                        Validate the schemas. Returns error if there is a problem.

                                                        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.