resource

package
v1.19.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 9 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OPERATOR_name = map[int32]string{
		0: "IN",
		1: "NOT_IN",
	}
	OPERATOR_value = map[string]int32{
		"IN":     0,
		"NOT_IN": 1,
	}
)

Enum value maps for OPERATOR.

View Source
var (
	VISIABLE_name = map[int32]string{
		0: "NAMESPACE",
		1: "DOMAIN",
		2: "GLOBAL",
	}
	VISIABLE_value = map[string]int32{
		"NAMESPACE": 0,
		"DOMAIN":    1,
		"GLOBAL":    2,
	}
)

Enum value maps for VISIABLE.

View Source
var File_mcube_pb_resource_label_proto protoreflect.FileDescriptor
View Source
var File_mcube_pb_resource_meta_proto protoreflect.FileDescriptor
View Source
var File_mcube_pb_resource_visiable_proto protoreflect.FileDescriptor

Functions

func ParseMapFromString added in v1.9.19

func ParseMapFromString(kvItems string) map[string]string

Types

type LabelRequirement added in v1.9.16

type LabelRequirement struct {

	// key is the label key that the selector applies to.
	// @gotags: bson:"match_lablels" json:"match_lablels"
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"match_lablels" bson:"match_lablels"`
	// operator represents a key's relationship to a set of values.
	// Valid operators are In, NotIn, Exists and DoesNotExist.
	// @gotags: bson:"operator" json:"operator"
	Operator OPERATOR `protobuf:"varint,2,opt,name=operator,proto3,enum=infraboard.mcube.resource.OPERATOR" json:"operator" bson:"operator"`
	// values is an array of string values. If the operator is In or NotIn,
	// the values array must be non-empty. If the operator is Exists or DoesNotExist,
	// the values array must be empty. This array is replaced during a strategic
	// @gotags: bson:"values" json:"values"
	Values []string `protobuf:"bytes,3,rep,name=values,proto3" json:"values" bson:"values"`
	// contains filtered or unexported fields
}

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

func NewLabelRequirement added in v1.9.16

func NewLabelRequirement(key string, values ...string) *LabelRequirement

key1=value1,key2=value2

func ParseLabelRequirementFromString added in v1.9.19

func ParseLabelRequirementFromString(str string) *LabelRequirement

key=value1,value2,value3

func ParseLabelRequirementListFromString added in v1.9.19

func ParseLabelRequirementListFromString(str string) (
	lables []*LabelRequirement)

func (*LabelRequirement) Descriptor deprecated added in v1.9.16

func (*LabelRequirement) Descriptor() ([]byte, []int)

Deprecated: Use LabelRequirement.ProtoReflect.Descriptor instead.

func (*LabelRequirement) Expr added in v1.9.16

func (l *LabelRequirement) Expr() string

func (*LabelRequirement) GetKey added in v1.9.16

func (x *LabelRequirement) GetKey() string

func (*LabelRequirement) GetOperator added in v1.9.16

func (x *LabelRequirement) GetOperator() OPERATOR

func (*LabelRequirement) GetValues added in v1.9.16

func (x *LabelRequirement) GetValues() []string

func (*LabelRequirement) IsMatchAll added in v1.9.16

func (l *LabelRequirement) IsMatchAll() bool

当Label的值为空或者*时匹配所有

func (*LabelRequirement) MakeLabelKey added in v1.9.16

func (l *LabelRequirement) MakeLabelKey(prefix string) string

func (*LabelRequirement) ProtoMessage added in v1.9.16

func (*LabelRequirement) ProtoMessage()

func (*LabelRequirement) ProtoReflect added in v1.9.16

func (x *LabelRequirement) ProtoReflect() protoreflect.Message

func (*LabelRequirement) Reset added in v1.9.16

func (x *LabelRequirement) Reset()

func (*LabelRequirement) String added in v1.9.16

func (x *LabelRequirement) String() string

type Meta added in v1.9.12

type Meta struct {

	// 对象Id
	// @gotags: bson:"_id" json:"id"
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
	// 创建时间
	// @gotags: bson:"create_at" json:"create_at"
	CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at" bson:"create_at"`
	// 更新时间
	// @gotags: bson:"update_at" json:"update_at"
	UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at" bson:"update_at"`
	// 更新人
	// @gotags: bson:"update_by" json:"update_by"
	UpdateBy string `protobuf:"bytes,4,opt,name=update_by,json=updateBy,proto3" json:"update_by" bson:"update_by"`
	// contains filtered or unexported fields
}

func NewMeta added in v1.9.14

func NewMeta() *Meta

func (*Meta) Descriptor deprecated added in v1.9.12

func (*Meta) Descriptor() ([]byte, []int)

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetCreateAt added in v1.9.12

func (x *Meta) GetCreateAt() int64

func (*Meta) GetId added in v1.9.12

func (x *Meta) GetId() string

func (*Meta) GetUpdateAt added in v1.9.12

func (x *Meta) GetUpdateAt() int64

func (*Meta) GetUpdateBy added in v1.9.12

func (x *Meta) GetUpdateBy() string

func (*Meta) IdWithPrefix added in v1.9.16

func (m *Meta) IdWithPrefix(prefix string) *Meta

func (*Meta) ProtoMessage added in v1.9.12

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect added in v1.9.12

func (x *Meta) ProtoReflect() protoreflect.Message

func (*Meta) Reset added in v1.9.12

func (x *Meta) Reset()

func (*Meta) String added in v1.9.12

func (x *Meta) String() string

type OPERATOR added in v1.9.16

type OPERATOR int32

A label selector operator is the set of operators that can be used in a selector requirement.

const (
	OPERATOR_IN     OPERATOR = 0
	OPERATOR_NOT_IN OPERATOR = 1
)

func ParseOPERATORFromString added in v1.9.16

func ParseOPERATORFromString(str string) (OPERATOR, error)

ParseOPERATORFromString Parse OPERATOR from string

func (OPERATOR) Descriptor added in v1.9.16

func (OPERATOR) Descriptor() protoreflect.EnumDescriptor

func (OPERATOR) Enum added in v1.9.16

func (x OPERATOR) Enum() *OPERATOR

func (OPERATOR) EnumDescriptor deprecated added in v1.9.16

func (OPERATOR) EnumDescriptor() ([]byte, []int)

Deprecated: Use OPERATOR.Descriptor instead.

func (OPERATOR) Equal added in v1.9.16

func (t OPERATOR) Equal(target OPERATOR) bool

Equal type compare

func (OPERATOR) Expr added in v1.9.16

func (o OPERATOR) Expr() string

func (OPERATOR) IsIn added in v1.9.16

func (t OPERATOR) IsIn(targets ...OPERATOR) bool

IsIn todo

func (OPERATOR) MarshalJSON added in v1.9.16

func (t OPERATOR) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (OPERATOR) Number added in v1.9.16

func (x OPERATOR) Number() protoreflect.EnumNumber

func (OPERATOR) String added in v1.9.16

func (x OPERATOR) String() string

func (OPERATOR) Type added in v1.9.16

func (*OPERATOR) UnmarshalJSON added in v1.9.16

func (t *OPERATOR) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

type Scope added in v1.9.16

type Scope struct {

	// 对象所在域
	// @gotags: bson:"domain" json:"domain"
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain" bson:"domain"`
	// 对象所在空间
	// @gotags: bson:"namespace" json:"namespace"
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace" bson:"namespace"`
	// contains filtered or unexported fields
}

func NewScope added in v1.9.16

func NewScope() *Scope

func (*Scope) Descriptor deprecated added in v1.9.16

func (*Scope) Descriptor() ([]byte, []int)

Deprecated: Use Scope.ProtoReflect.Descriptor instead.

func (*Scope) GetDomain added in v1.9.16

func (x *Scope) GetDomain() string

func (*Scope) GetNamespace added in v1.9.16

func (x *Scope) GetNamespace() string

func (*Scope) ProtoMessage added in v1.9.16

func (*Scope) ProtoMessage()

func (*Scope) ProtoReflect added in v1.9.16

func (x *Scope) ProtoReflect() protoreflect.Message

func (*Scope) Reset added in v1.9.16

func (x *Scope) Reset()

func (*Scope) String added in v1.9.16

func (x *Scope) String() string

type Selector added in v1.9.16

type Selector struct {

	// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
	// map is equivalent to an element of matchExpressions, whose key field is "key", the
	// operator is "In", and the values array contains only "value". The requirements are ANDed.
	// @gotags: bson:"match_lablels" json:"match_lablels"
	MatchLablels map[string]string `` /* 196-byte string literal not displayed */
	// matchExpressions is a list of label selector requirements. The requirements are ANDed.
	// @gotags: bson:"match_lablels" json:"match_expressions"
	MatchExpressions []*LabelRequirement `protobuf:"bytes,2,rep,name=match_expressions,json=matchExpressions,proto3" json:"match_expressions" bson:"match_lablels"`
	// contains filtered or unexported fields
}

A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. +structType=atomic

func (*Selector) Descriptor deprecated added in v1.9.16

func (*Selector) Descriptor() ([]byte, []int)

Deprecated: Use Selector.ProtoReflect.Descriptor instead.

func (*Selector) GetMatchExpressions added in v1.9.16

func (x *Selector) GetMatchExpressions() []*LabelRequirement

func (*Selector) GetMatchLablels added in v1.9.16

func (x *Selector) GetMatchLablels() map[string]string

func (*Selector) ProtoMessage added in v1.9.16

func (*Selector) ProtoMessage()

func (*Selector) ProtoReflect added in v1.9.16

func (x *Selector) ProtoReflect() protoreflect.Message

func (*Selector) Reset added in v1.9.16

func (x *Selector) Reset()

func (*Selector) String added in v1.9.16

func (x *Selector) String() string

type VISIABLE added in v1.9.16

type VISIABLE int32
const (
	// 默认Namespace可见
	VISIABLE_NAMESPACE VISIABLE = 0
	// 域内可见
	VISIABLE_DOMAIN VISIABLE = 1
	// 全局可见
	VISIABLE_GLOBAL VISIABLE = 2
)

func ParseVISIABLEFromString added in v1.9.16

func ParseVISIABLEFromString(str string) (VISIABLE, error)

ParseVISIABLEFromString Parse VISIABLE from string

func (VISIABLE) Descriptor added in v1.9.16

func (VISIABLE) Descriptor() protoreflect.EnumDescriptor

func (VISIABLE) Enum added in v1.9.16

func (x VISIABLE) Enum() *VISIABLE

func (VISIABLE) EnumDescriptor deprecated added in v1.9.16

func (VISIABLE) EnumDescriptor() ([]byte, []int)

Deprecated: Use VISIABLE.Descriptor instead.

func (VISIABLE) Equal added in v1.9.16

func (t VISIABLE) Equal(target VISIABLE) bool

Equal type compare

func (VISIABLE) IsIn added in v1.9.16

func (t VISIABLE) IsIn(targets ...VISIABLE) bool

IsIn todo

func (VISIABLE) MarshalJSON added in v1.9.16

func (t VISIABLE) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (VISIABLE) Number added in v1.9.16

func (x VISIABLE) Number() protoreflect.EnumNumber

func (VISIABLE) String added in v1.9.16

func (x VISIABLE) String() string

func (VISIABLE) Type added in v1.9.16

func (*VISIABLE) UnmarshalJSON added in v1.9.16

func (t *VISIABLE) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL