Documentation ¶
Index ¶
- Variables
- func ParseMapFromString(kvItems string) map[string]string
- type LabelRequirement
- func (*LabelRequirement) Descriptor() ([]byte, []int)deprecated
- func (l *LabelRequirement) Expr() string
- func (x *LabelRequirement) GetKey() string
- func (x *LabelRequirement) GetOperator() OPERATOR
- func (x *LabelRequirement) GetValues() []string
- func (l *LabelRequirement) IsMatchAll() bool
- func (l *LabelRequirement) MakeLabelKey(prefix string) string
- func (*LabelRequirement) ProtoMessage()
- func (x *LabelRequirement) ProtoReflect() protoreflect.Message
- func (x *LabelRequirement) Reset()
- func (x *LabelRequirement) String() string
- type Meta
- func (*Meta) Descriptor() ([]byte, []int)deprecated
- func (x *Meta) GetCreateAt() int64
- func (x *Meta) GetId() string
- func (x *Meta) GetUpdateAt() int64
- func (x *Meta) GetUpdateBy() string
- func (m *Meta) IdWithPrefix(prefix string) *Meta
- func (*Meta) ProtoMessage()
- func (x *Meta) ProtoReflect() protoreflect.Message
- func (x *Meta) Reset()
- func (x *Meta) String() string
- type OPERATOR
- func (OPERATOR) Descriptor() protoreflect.EnumDescriptor
- func (x OPERATOR) Enum() *OPERATOR
- func (OPERATOR) EnumDescriptor() ([]byte, []int)deprecated
- func (t OPERATOR) Equal(target OPERATOR) bool
- func (o OPERATOR) Expr() string
- func (t OPERATOR) IsIn(targets ...OPERATOR) bool
- func (t OPERATOR) MarshalJSON() ([]byte, error)
- func (x OPERATOR) Number() protoreflect.EnumNumber
- func (x OPERATOR) String() string
- func (OPERATOR) Type() protoreflect.EnumType
- func (t *OPERATOR) UnmarshalJSON(b []byte) error
- type Scope
- type Selector
- func (*Selector) Descriptor() ([]byte, []int)deprecated
- func (x *Selector) GetMatchExpressions() []*LabelRequirement
- func (x *Selector) GetMatchLablels() map[string]string
- func (*Selector) ProtoMessage()
- func (x *Selector) ProtoReflect() protoreflect.Message
- func (x *Selector) Reset()
- func (x *Selector) String() string
- type VISIABLE
- func (VISIABLE) Descriptor() protoreflect.EnumDescriptor
- func (x VISIABLE) Enum() *VISIABLE
- func (VISIABLE) EnumDescriptor() ([]byte, []int)deprecated
- func (t VISIABLE) Equal(target VISIABLE) bool
- func (t VISIABLE) IsIn(targets ...VISIABLE) bool
- func (t VISIABLE) MarshalJSON() ([]byte, error)
- func (x VISIABLE) Number() protoreflect.EnumNumber
- func (x VISIABLE) String() string
- func (VISIABLE) Type() protoreflect.EnumType
- func (t *VISIABLE) UnmarshalJSON(b []byte) error
Constants ¶
This section is empty.
Variables ¶
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.
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.
var File_mcube_pb_resource_label_proto protoreflect.FileDescriptor
var File_mcube_pb_resource_meta_proto protoreflect.FileDescriptor
var File_mcube_pb_resource_visiable_proto protoreflect.FileDescriptor
Functions ¶
func ParseMapFromString ¶ added in v1.9.19
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 (*Meta) Descriptor
deprecated
added in
v1.9.12
func (*Meta) GetCreateAt ¶ added in v1.9.12
func (*Meta) GetUpdateAt ¶ added in v1.9.12
func (*Meta) GetUpdateBy ¶ added in v1.9.12
func (*Meta) IdWithPrefix ¶ added in v1.9.16
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
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.
func ParseOPERATORFromString ¶ added in v1.9.16
ParseOPERATORFromString Parse OPERATOR from string
func (OPERATOR) Descriptor ¶ added in v1.9.16
func (OPERATOR) Descriptor() protoreflect.EnumDescriptor
func (OPERATOR) EnumDescriptor
deprecated
added in
v1.9.16
func (OPERATOR) MarshalJSON ¶ added in v1.9.16
MarshalJSON todo
func (OPERATOR) Number ¶ added in v1.9.16
func (x OPERATOR) Number() protoreflect.EnumNumber
func (OPERATOR) Type ¶ added in v1.9.16
func (OPERATOR) Type() protoreflect.EnumType
func (*OPERATOR) UnmarshalJSON ¶ added in v1.9.16
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 (*Scope) Descriptor
deprecated
added in
v1.9.16
func (*Scope) GetNamespace ¶ added in v1.9.16
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
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) GetMatchExpressions ¶ added in v1.9.16
func (x *Selector) GetMatchExpressions() []*LabelRequirement
func (*Selector) GetMatchLablels ¶ added in v1.9.16
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
type VISIABLE ¶ added in v1.9.16
type VISIABLE int32
func ParseVISIABLEFromString ¶ added in v1.9.16
ParseVISIABLEFromString Parse VISIABLE from string
func (VISIABLE) Descriptor ¶ added in v1.9.16
func (VISIABLE) Descriptor() protoreflect.EnumDescriptor
func (VISIABLE) EnumDescriptor
deprecated
added in
v1.9.16
func (VISIABLE) MarshalJSON ¶ added in v1.9.16
MarshalJSON todo
func (VISIABLE) Number ¶ added in v1.9.16
func (x VISIABLE) Number() protoreflect.EnumNumber
func (VISIABLE) Type ¶ added in v1.9.16
func (VISIABLE) Type() protoreflect.EnumType
func (*VISIABLE) UnmarshalJSON ¶ added in v1.9.16
UnmarshalJSON todo