istio: Index | Files

package resource

import ""


Package Files


func FromKubernetesGVK Uses

func FromKubernetesGVK(in *schema.GroupVersionKind) config.GroupVersionKind

FromKubernetesGVK converts a Kubernetes GVK to an Istio GVK

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

    StatusProto string

    // ReflectType is the type of the go struct
    ReflectType reflect.Type

    // StatusType is the type of the associated status.
    StatusType reflect.Type

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

    // StatusPackage refers to the name of the golang status package.
    StatusPackage 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 Schema Uses

type Schema interface {

    // GroupVersionKind of the resource. This is the only way to uniquely identify a resource.
    GroupVersionKind() config.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

    // NewInstance returns a new instance of the protocol buffer message for this resource.
    NewInstance() (config.Spec, error)

    // Status returns the associated status of the schema
    Status() (config.Status, error)

    StatusKind() string

    StatusPackage() string

    // MustNewInstance calls NewInstance and panics if an error occurs.
    MustNewInstance() config.Spec

    // Validate this schema.
    Validate() error

    // ValidateConfig validates that the given config message is of the correct type for this schema
    // and that the contents are valid.
    ValidateConfig(cfg config.Config) (validation.Warning, 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 9 packages (graph) and is imported by 29 packages. Updated 2020-10-19. Refresh now. Tools for package owners.