Documentation

Index

Constants

View Source
const (
	DefaultMesh = "default"
	// NoMesh defines a marker that resource is not bound to a Mesh.
	// Resources not bound to a mesh (ScopeGlobal) should have an empty string in Mesh field.
	NoMesh = ""
)
View Source
const (
	ScopeMesh   = "Mesh"
	ScopeGlobal = "Global"
)

Variables

View Source
var (
	// ResourceNameExtensionsUnsupported is a convenience constant
	// that is meant to make source code more readable.
	ResourceNameExtensionsUnsupported = ResourceNameExtensions(nil)
)

Functions

func ErrorInvalidItemType

func ErrorInvalidItemType(expected, actual interface{}) error

Types

type ByMeta

type ByMeta []Resource

func (ByMeta) Len

func (a ByMeta) Len() int

func (ByMeta) Less

func (a ByMeta) Less(i, j int) bool

func (ByMeta) Swap

func (a ByMeta) Swap(i, j int)

type Pagination

type Pagination struct {
	Total      uint32
	NextOffset string
}

func (*Pagination) GetNextOffset

func (p *Pagination) GetNextOffset() string

func (*Pagination) GetTotal

func (p *Pagination) GetTotal() uint32

func (*Pagination) SetNextOffset

func (p *Pagination) SetNextOffset(nextOffset string)

func (*Pagination) SetTotal

func (p *Pagination) SetTotal(total uint32)

type Resource

type Resource interface {
	GetType() ResourceType
	GetMeta() ResourceMeta
	SetMeta(ResourceMeta)
	GetSpec() ResourceSpec
	SetSpec(ResourceSpec) error
	Validate() error
	Scope() ResourceScope
}

type ResourceKey

type ResourceKey struct {
	Mesh string
	Name string
}

func MetaToResourceKey

func MetaToResourceKey(meta ResourceMeta) ResourceKey

type ResourceList

type ResourceList interface {
	GetItemType() ResourceType
	GetItems() []Resource
	NewItem() Resource
	AddItem(Resource) error
	GetPagination() *Pagination
}

type ResourceMeta

type ResourceMeta interface {
	GetName() string
	GetNameExtensions() ResourceNameExtensions
	GetVersion() string
	GetMesh() string
	GetCreationTime() time.Time
	GetModificationTime() time.Time
}

type ResourceNameExtensions

type ResourceNameExtensions map[string]string

    ResourceNameExtensions represents an composite resource name in environments other than Universal.

    E.g., name of a Kubernetes resource consists of a namespace component and a name component that is local to that namespace.

    Technically, ResourceNameExtensions is a mapping between a component identifier and a component value, e.g.

    "k8s.kuma.io/namespace" => "my-namespace"
    "k8s.kuma.io/name"      => "my-policy"
    

    Component identifier must be considered a part of user-facing Kuma API. In other words, it is supposed to be visible to users and should not be changed lightly.

    Component identifier might have any value, however, it's preferable to choose one that is intuitive to users of that particular environment. E.g., on Kubernetes component identifiers should use a label name format, like in "k8s.kuma.io/namespace" and "k8s.kuma.io/name".

    type ResourceScope

    type ResourceScope string

    type ResourceSpec

    type ResourceSpec interface {
    	// all resources must be defined via Protobuf
    	proto.Message
    }

    type ResourceType

    type ResourceType string

    Source Files

    Directories

    Path Synopsis