selector

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

The selector package exports functions useful for manipulating and generating spire selectors

Index

Constants

View Source
const Delimiter = ":"

Type and Value are delimited by a colon (:) e.g. "unix:uid:1000"

Variables

This section is empty.

Functions

func Dedupe added in v1.4.0

func Dedupe(selectorSets ...[]*common.Selector) []*common.Selector

func EqualSet

func EqualSet(a, b *set) bool

EqualSet determines whether two sets of selectors are equal or not

func Includes

func Includes(set *set, item *Selector) bool

Includes determines whether a given selector is present in a set

func IncludesSet

func IncludesSet(s1, s2 *set) bool

IncludesSet returns true if s2 is included in s1. This is, all the s2 selectors are also present in s1.

func PowerSet

func PowerSet(selectors *set) <-chan Set

PowerSet implements a range-able combination generator. It takes a set, and returns a channel over which all possible combinations of selectors are eventually returned. It is meant to aid in the discovery of applicable cache entries, given the superset of selectors discovered during attestation.

func Validate added in v0.12.0

func Validate(s *common.Selector) error

Types

type Selector

type Selector struct {
	Type  string
	Value string
}

func New

func New(c *common.Selector) *Selector

func (*Selector) Raw

func (s *Selector) Raw() *common.Selector

type Set

type Set interface {
	Raw() []*common.Selector
	Array() []*Selector
	Power() <-chan Set
	Equal(otherSet Set) bool
	Includes(selector *Selector) bool
	IncludesSet(s2 Set) bool
	Add(selector *Selector)
	Remove(selector *Selector) *Selector
	String() string
	Size() int
}

func NewSet

func NewSet(selectors ...*Selector) Set

func NewSetFromRaw

func NewSetFromRaw(c []*common.Selector) Set

Jump to

Keyboard shortcuts

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