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"


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


func ErrorInvalidItemType

func ErrorInvalidItemType(expected, actual interface{}) error


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

    "" => "my-namespace"
    ""      => "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 "" and "".

    type ResourceScope

    type ResourceScope string

    type ResourceSpec

    type ResourceSpec interface {
    	// all resources must be defined via Protobuf

    type ResourceType

    type ResourceType string

    Source Files


    Path Synopsis