resource

package
v2.0.36 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 9 Imported by: 23

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

func ParseMapFromString(kvItems string) map[string]string

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 NewMeta

func NewMeta() *Meta

func (*Meta) Descriptor deprecated

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

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetCreateAt

func (x *Meta) GetCreateAt() int64

func (*Meta) GetId

func (x *Meta) GetId() string

func (*Meta) GetUpdateAt

func (x *Meta) GetUpdateAt() int64

func (*Meta) GetUpdateBy

func (x *Meta) GetUpdateBy() string

func (*Meta) IdWithPrefix

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

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect

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

func (*Meta) Reset

func (x *Meta) Reset()

func (*Meta) String

func (x *Meta) String() string

type OPERATOR

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

func ParseOPERATORFromString(str string) (OPERATOR, error)

ParseOPERATORFromString Parse OPERATOR from string

func (OPERATOR) Descriptor

func (OPERATOR) Descriptor() protoreflect.EnumDescriptor

func (OPERATOR) Enum

func (x OPERATOR) Enum() *OPERATOR

func (OPERATOR) EnumDescriptor deprecated

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

Deprecated: Use OPERATOR.Descriptor instead.

func (OPERATOR) Equal

func (t OPERATOR) Equal(target OPERATOR) bool

Equal type compare

func (OPERATOR) Expr

func (o OPERATOR) Expr() string

func (OPERATOR) IsIn

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

IsIn todo

func (OPERATOR) MarshalJSON

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

MarshalJSON todo

func (OPERATOR) Number

func (x OPERATOR) Number() protoreflect.EnumNumber

func (OPERATOR) String

func (x OPERATOR) String() string

func (OPERATOR) Type

func (*OPERATOR) UnmarshalJSON

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

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 NewScope

func NewScope() *Scope

func (*Scope) Descriptor deprecated

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

Deprecated: Use Scope.ProtoReflect.Descriptor instead.

func (*Scope) GetDomain

func (x *Scope) GetDomain() string

func (*Scope) GetNamespace

func (x *Scope) GetNamespace() string

func (*Scope) ProtoMessage

func (*Scope) ProtoMessage()

func (*Scope) ProtoReflect

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

func (*Scope) Reset

func (x *Scope) Reset()

func (*Scope) String

func (x *Scope) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Selector.ProtoReflect.Descriptor instead.

func (*Selector) GetMatchExpressions

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

func (*Selector) GetMatchLablels

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

func (*Selector) ProtoMessage

func (*Selector) ProtoMessage()

func (*Selector) ProtoReflect

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

func (*Selector) Reset

func (x *Selector) Reset()

func (*Selector) String

func (x *Selector) String() string

type VISIABLE

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

func ParseVISIABLEFromString

func ParseVISIABLEFromString(str string) (VISIABLE, error)

ParseVISIABLEFromString Parse VISIABLE from string

func (VISIABLE) Descriptor

func (VISIABLE) Descriptor() protoreflect.EnumDescriptor

func (VISIABLE) Enum

func (x VISIABLE) Enum() *VISIABLE

func (VISIABLE) EnumDescriptor deprecated

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

Deprecated: Use VISIABLE.Descriptor instead.

func (VISIABLE) Equal

func (t VISIABLE) Equal(target VISIABLE) bool

Equal type compare

func (VISIABLE) IsIn

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

IsIn todo

func (VISIABLE) MarshalJSON

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

MarshalJSON todo

func (VISIABLE) Number

func (x VISIABLE) Number() protoreflect.EnumNumber

func (VISIABLE) String

func (x VISIABLE) String() string

func (VISIABLE) Type

func (*VISIABLE) UnmarshalJSON

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