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 ¶
Types ¶
type LabelRequirement ¶
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 ¶
func NewLabelRequirement(key string, values ...string) *LabelRequirement
key1=value1,key2=value2
func ParseLabelRequirementFromString ¶
func ParseLabelRequirementFromString(str string) *LabelRequirement
key=value1,value2,value3
func ParseLabelRequirementListFromString ¶
func ParseLabelRequirementListFromString(str string) ( lables []*LabelRequirement)
func (*LabelRequirement) Descriptor
deprecated
func (*LabelRequirement) Descriptor() ([]byte, []int)
Deprecated: Use LabelRequirement.ProtoReflect.Descriptor instead.
func (*LabelRequirement) Expr ¶
func (l *LabelRequirement) Expr() string
func (*LabelRequirement) GetKey ¶
func (x *LabelRequirement) GetKey() string
func (*LabelRequirement) GetOperator ¶
func (x *LabelRequirement) GetOperator() OPERATOR
func (*LabelRequirement) GetValues ¶
func (x *LabelRequirement) GetValues() []string
func (*LabelRequirement) IsMatchAll ¶
func (l *LabelRequirement) IsMatchAll() bool
当Label的值为空或者*时匹配所有
func (*LabelRequirement) MakeLabelKey ¶
func (l *LabelRequirement) MakeLabelKey(prefix string) string
func (*LabelRequirement) ProtoMessage ¶
func (*LabelRequirement) ProtoMessage()
func (*LabelRequirement) ProtoReflect ¶
func (x *LabelRequirement) ProtoReflect() protoreflect.Message
func (*LabelRequirement) Reset ¶
func (x *LabelRequirement) Reset()
func (*LabelRequirement) String ¶
func (x *LabelRequirement) String() string
type Meta ¶
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
func (*Meta) GetCreateAt ¶
func (*Meta) GetUpdateAt ¶
func (*Meta) GetUpdateBy ¶
func (*Meta) IdWithPrefix ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type OPERATOR ¶
type OPERATOR int32
A label selector operator is the set of operators that can be used in a selector requirement.
func ParseOPERATORFromString ¶
ParseOPERATORFromString Parse OPERATOR from string
func (OPERATOR) Descriptor ¶
func (OPERATOR) Descriptor() protoreflect.EnumDescriptor
func (OPERATOR) EnumDescriptor
deprecated
func (OPERATOR) Number ¶
func (x OPERATOR) Number() protoreflect.EnumNumber
func (OPERATOR) Type ¶
func (OPERATOR) Type() protoreflect.EnumType
func (*OPERATOR) UnmarshalJSON ¶
UnmarshalJSON todo
type Scope ¶
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
func (*Scope) GetNamespace ¶
func (*Scope) ProtoMessage ¶
func (*Scope) ProtoMessage()
func (*Scope) ProtoReflect ¶
func (x *Scope) ProtoReflect() protoreflect.Message
type Selector ¶
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
func (*Selector) GetMatchExpressions ¶
func (x *Selector) GetMatchExpressions() []*LabelRequirement
func (*Selector) GetMatchLablels ¶
func (*Selector) ProtoMessage ¶
func (*Selector) ProtoMessage()
func (*Selector) ProtoReflect ¶
func (x *Selector) ProtoReflect() protoreflect.Message
type VISIABLE ¶
type VISIABLE int32
func ParseVISIABLEFromString ¶
ParseVISIABLEFromString Parse VISIABLE from string
func (VISIABLE) Descriptor ¶
func (VISIABLE) Descriptor() protoreflect.EnumDescriptor
func (VISIABLE) EnumDescriptor
deprecated
func (VISIABLE) Number ¶
func (x VISIABLE) Number() protoreflect.EnumNumber
func (VISIABLE) Type ¶
func (VISIABLE) Type() protoreflect.EnumType
func (*VISIABLE) UnmarshalJSON ¶
UnmarshalJSON todo