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

package resource

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

Index

Package Files

schema.go

type Builder Uses

type Builder struct {
    // ClusterScoped is true for resource in cluster-level.
    ClusterScoped bool

    // Kind is the config proto type.
    Kind string

    // Plural is the type in plural.
    Plural string

    // Group is the config proto group.
    Group string

    // Version is the config proto version.
    Version string

    // Proto refers to the protobuf message type name corresponding to the type
    Proto string

    // ProtoPackage refers to the name of golang package for the protobuf message.
    ProtoPackage string

    // ValidateProto performs validation on protobuf messages based on this schema.
    ValidateProto validation.ValidateFunc
}

Builder for a Schema.

func (Builder) Build Uses

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

Build a Schema instance.

func (Builder) BuildNoValidate Uses

func (b Builder) BuildNoValidate() Schema

BuildNoValidate builds the Schema without checking the fields.

func (Builder) MustBuild Uses

func (b Builder) MustBuild() Schema

MustBuild calls Build and panics if it fails.

type GroupVersionKind Uses

type GroupVersionKind struct {
    Group   string `json:"group"`
    Version string `json:"version"`
    Kind    string `json:"kind"`
}

func FromKubernetesGVK Uses

func FromKubernetesGVK(in *schema.GroupVersionKind) GroupVersionKind

FromKubernetesGVK converts a Kubernetes GVK to an Istio GVK

func (GroupVersionKind) String Uses

func (g GroupVersionKind) String() string

type Schema Uses

type Schema interface {
    fmt.Stringer

    // GroupVersionKind of the resource. This is the only way to uniquely identify a resource.
    GroupVersionKind() GroupVersionKind

    // GroupVersionResource of the resource.
    GroupVersionResource() schema.GroupVersionResource

    // IsClusterScoped indicates that this resource is scoped to a particular namespace within a cluster.
    IsClusterScoped() bool

    // Kind for this resource.
    Kind() string

    // Plural returns the plural form of the Kind.
    Plural() string

    // Group for this resource.
    Group() string

    // Version of this resource.
    Version() string

    // APIVersion is a utility that returns a k8s API version string of the form "Group/Version".
    APIVersion() string

    // Proto returns the protocol buffer type name for this resource.
    Proto() string

    // ProtoPackage returns the golang package for the protobuf resource.
    ProtoPackage() string

    // NewProtoInstance returns a new instance of the protocol buffer message for this resource.
    NewProtoInstance() (proto.Message, error)

    // MustNewProtoInstance calls NewProtoInstance and panics if an error occurs.
    MustNewProtoInstance() proto.Message

    // Validate this schema.
    Validate() error

    // ValidateProto validates that the given protocol buffer message is of the correct type for this schema
    // and that the contents are valid.
    ValidateProto(name, namespace string, config proto.Message) error

    // 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 resource.

Package resource imports 7 packages (graph) and is imported by 45 packages. Updated 2020-08-04. Refresh now. Tools for package owners.