selection

package
v0.12.0-beta8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 12 Imported by: 4

Documentation

Overview

Package selection provides labeling and selection infrastructure.

Index

Constants

This section is empty.

Variables

View Source
var File_selection_selection_proto protoreflect.FileDescriptor

Functions

func EnsureLabelKeyValid

func EnsureLabelKeyValid(key string) error

EnsureLabelKeyValid verifies that a key conforms to label key requirements. These requirements are currently the same as those for Kubernetes label keys.

func EnsureLabelValueValid

func EnsureLabelValueValid(value string) error

EnsureLabelValueValid verifies that a value conforms to label value requirements. These requirements are currently the same as those for Kubernetes label values.

func EnsureNameValid

func EnsureNameValid(name string) error

EnsureNameValid ensures that a name is valid for use as a session name. Empty names are treated as valid.

func ExtractAndSortLabelKeys

func ExtractAndSortLabelKeys(labels map[string]string) []string

ExtractAndSortLabelKeys extracts a list of keys from the label set and sorts them.

Types

type LabelSelector

type LabelSelector interface {
	// Matches checks whether or not a set of labels is matched by the selector.
	Matches(labels map[string]string) bool
}

LabelSelector is a type that performs matching against a set of labels.

func ParseLabelSelector

func ParseLabelSelector(selector string) (LabelSelector, error)

ParseLabelSelector performs label selector parsing. The syntax is currently the same as that for Kubernetes.

type Selection

type Selection struct {

	// All, if true, indicates that all sessions should be selected.
	All bool `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"`
	// Specifications is a list of session specifications. Each element may be
	// either a session identifier or name (or a prefix thereof). If non-empty,
	// it indicates that these specifications should be used to select sessions.
	Specifications []string `protobuf:"bytes,2,rep,name=specifications,proto3" json:"specifications,omitempty"`
	// LabelSelector is a label selector specification. If present (non-empty),
	// it indicates that this selector should be used to select sessions.
	LabelSelector string `protobuf:"bytes,3,opt,name=labelSelector,proto3" json:"labelSelector,omitempty"`
	// contains filtered or unexported fields
}

Selection encodes a selection mechanism that can be used to select a collection of sessions. It should have exactly one member set.

func (*Selection) Descriptor deprecated

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

Deprecated: Use Selection.ProtoReflect.Descriptor instead.

func (*Selection) EnsureValid

func (s *Selection) EnsureValid() error

EnsureValid verifies that a Selection is valid.

func (*Selection) GetAll

func (x *Selection) GetAll() bool

func (*Selection) GetLabelSelector

func (x *Selection) GetLabelSelector() string

func (*Selection) GetSpecifications

func (x *Selection) GetSpecifications() []string

func (*Selection) ProtoMessage

func (*Selection) ProtoMessage()

func (*Selection) ProtoReflect added in v0.12.0

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

func (*Selection) Reset

func (x *Selection) Reset()

func (*Selection) String

func (x *Selection) String() string

Jump to

Keyboard shortcuts

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