istio: Index | Files | Directories

package schema

import ""


Package Files

instance.go resourcespec.go

type Builder Uses

type Builder struct {
    // contains filtered or unexported fields

Builder is a builder for schema.

func NewBuilder Uses

func NewBuilder() *Builder

NewBuilder returns a new instance of a Builder.

func (*Builder) Add Uses

func (b *Builder) Add(spec ...ResourceSpec) *Builder

Add a new ResourceSpec to the schema.

func (*Builder) Build Uses

func (b *Builder) Build() *Instance

Build a new instance of schema. The specs will be sorted by resource name.

type Instance Uses

type Instance struct {
    // contains filtered or unexported fields

Instance represents a schema for a set of known Kubernetes resource types.

func New Uses

func New(spec ...ResourceSpec) *Instance

New is a simplified Instance factory method when all specs can be provided as arguments.

func (*Instance) All Uses

func (s *Instance) All() []ResourceSpec

All returns information about all known types.

func (*Instance) Get Uses

func (s *Instance) Get(kind string) *ResourceSpec

Get returns the schema for the given kind, or nil if not found.

type ResourceSpec Uses

type ResourceSpec struct {

    // Singular name of the K8s resource
    Singular string

    // Plural name of the K8s resource
    Plural string

    // Group name of the K8s resource
    Group string

    // Versions of the K8s resource
    Versions []string

    // Kind of the K8s resource
    Kind string

    // ListKind of the K8s resource
    ListKind string

    // Target resource type of the resource
    Target resource.Info

    // The converter to use
    Converter converter.Fn

    // Indicates that the resource is not required to be present
    Optional bool

ResourceSpec represents a known crd. It is used to drive the K8s-related machinery, and to map to the proto format.

func (*ResourceSpec) APIResource Uses

func (i *ResourceSpec) APIResource() *metaV1.APIResource

APIResource generated from this type.

func (*ResourceSpec) CanonicalResourceName Uses

func (i *ResourceSpec) CanonicalResourceName() string

CanonicalResourceName of the resource.

func (*ResourceSpec) GetAPIVersion Uses

func (i *ResourceSpec) GetAPIVersion() string

GetAPIVersion returns the earlist served version for a given CRD.

func (*ResourceSpec) GroupVersion Uses

func (i *ResourceSpec) GroupVersion() sc.GroupVersion

GroupVersion returns the GroupVersion of this type.



Package schema imports 8 packages (graph) and is imported by 9 packages. Updated 2019-06-12. Refresh now. Tools for package owners.