istio: istio.io/istio/pkg/config/schema/collection Index | Files

package collection

import "istio.io/istio/pkg/config/schema/collection"

Index

Package Files

name.go names.go schema.go schemas.go

func IsValidName Uses

func IsValidName(name string) bool

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

type Builder Uses

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

Config for the creation of a Schema

func (Builder) Build Uses

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

Build a Schema instance.

func (Builder) MustBuild Uses

func (b Builder) MustBuild() Schema

MustBuild calls Build and panics if it fails.

type Name Uses

type Name string

Name of a collection.

func NewName Uses

func NewName(n string) Name

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

func (Name) String Uses

func (n Name) String() string

String interface method implementation.

type Names Uses

type Names []Name

Names is a collection of names

func (Names) Clone Uses

func (n Names) Clone() Names

Clone names

func (Names) Sort Uses

func (n Names) Sort()

Sort the names in ascending order.

type Schema Uses

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

    // 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 Uses

type Schemas struct {
    // contains filtered or unexported fields
}

Schemas contains metadata about configuration resources.

func SchemasFor Uses

func SchemasFor(schemas ...Schema) Schemas

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

func (Schemas) Add Uses

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

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

func (Schemas) All Uses

func (s Schemas) All() []Schema

All returns all known Schemas

func (Schemas) CollectionNames Uses

func (s Schemas) CollectionNames() Names

CollectionNames returns all known collections.

func (Schemas) DisabledCollectionNames Uses

func (s Schemas) DisabledCollectionNames() Names

DisabledCollectionNames returns the names of disabled collections

func (Schemas) Equal Uses

func (s Schemas) Equal(o Schemas) bool

func (Schemas) Find Uses

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

Find looks up a Schema by its collection name.

func (Schemas) FindByGroupVersionKind Uses

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

FindByKind searches and returns the first schema with the given kind

func (Schemas) FindByPlural Uses

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

FindByKind searches and returns the first schema with the given kind

func (Schemas) ForEach Uses

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 Uses

func (s Schemas) Kinds() []string

Kinds returns all known resource kinds.

func (Schemas) MustFind Uses

func (s Schemas) MustFind(collection string) Schema

MustFind calls Find and panics if not found.

func (Schemas) MustFindByGroupVersionKind Uses

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

MustFind calls FindByGroupVersionKind and panics if not found.

func (Schemas) Remove Uses

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

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

func (Schemas) Validate Uses

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

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

type SchemasBuilder Uses

type SchemasBuilder struct {
    // contains filtered or unexported fields
}

SchemasBuilder is a builder for the schemas type.

func NewSchemasBuilder Uses

func NewSchemasBuilder() *SchemasBuilder

NewSchemasBuilder returns a new instance of SchemasBuilder.

func (*SchemasBuilder) Add Uses

func (b *SchemasBuilder) Add(s Schema) error

Add a new collection to the schemas.

func (*SchemasBuilder) Build Uses

func (b *SchemasBuilder) Build() Schemas

Build a new schemas from this SchemasBuilder.

func (*SchemasBuilder) MustAdd Uses

func (b *SchemasBuilder) MustAdd(s Schema) *SchemasBuilder

MustAdd calls Add and panics if it fails.

Package collection imports 8 packages (graph) and is imported by 66 packages. Updated 2020-09-03. Refresh now. Tools for package owners.