scope

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventScope

type EventScope Scope

EventScope defines the Scope labels for an EventsService.Create

func NewEventScope

func NewEventScope() *EventScope

NewEventScope initializes a new EventScope to be used for adding scope labels to an event in EventsService.Create.

func NewEventScopeWithLabels

func NewEventScopeWithLabels(labels map[string]string) *EventScope

NewEventScopeWithLabels initializes a new EventScope with the provided scope labels.

func (*EventScope) AddIsSelection

func (s *EventScope) AddIsSelection(label, value string) *EventScope

AddIsSelection adds a label to the EventScope with the given value.

func (*EventScope) String

func (s *EventScope) String() string

String is implemented via the Scope.String() method.

type Scope

type Scope struct {
	// contains filtered or unexported fields
}

Scope defines a filter for an EventsService.List.

func New

func New() *Scope

New initializes a new Scope to be used for filters in EventsService.List.

func (*Scope) AddContainsSelection

func (s *Scope) AddContainsSelection(label string, value string) *Scope

AddContainsSelection adds a filter to the Scope with the given label, value and SelectionContains selector.

func (*Scope) AddDoesNotContainSelection

func (s *Scope) AddDoesNotContainSelection(label string, value string) *Scope

AddDoesNotContainSelection adds a filter to the Scope with the given label, value and DoesNotContain selector.

func (*Scope) AddInSelection

func (s *Scope) AddInSelection(label string, values ...string) *Scope

AddInSelection adds a filter to the Scope with the given label, value and SelectionIn selector.

func (*Scope) AddIsNotSelection

func (s *Scope) AddIsNotSelection(label, value string) *Scope

AddIsNotSelection adds a filter to the Scope with the given label, value and SelectionIsNot selector.

func (*Scope) AddIsSelection

func (s *Scope) AddIsSelection(label, value string) *Scope

AddIsSelection adds a filter to the Scope with the given label, value and SelectionIs selector.

func (*Scope) AddNotInSelection

func (s *Scope) AddNotInSelection(label string, values ...string) *Scope

AddNotInSelection adds a filter to the Scope with the given label, value and SelectionNotIn selector.

func (*Scope) AddSelection

func (s *Scope) AddSelection(selector Selector, label, value string) *Scope

AddSelection adds a filter to the Scope with the given label, value and selector. Note: You should prefer to use the explicitly scoped Add functions to ensure you do not accidentally add multiple values when only one is supported. e.g. if you add multiple values to SelectionIs Selection, the values will be joined which is probably not what you want.

func (*Scope) AddSelectionMultiple

func (s *Scope) AddSelectionMultiple(selector Selector, label string, values ...string) *Scope

AddSelectionMultiple adds a filter to the Scope with the given label, value and selector. // Note: You should prefer to use the explicitly scoped Add functions to ensure you do not // accidentally add multiple values when only one is supported. e.g. if you add multiple // values to SelectionIs Selection, the values will be joined which is probably // not what you want.

func (*Scope) AddStartsWithSelection

func (s *Scope) AddStartsWithSelection(label, value string) *Scope

AddStartsWithSelection adds a filter to the Scope with the given label, value and SelectionStartsWith selector.

func (*Scope) String

func (s *Scope) String() string

String defines fmt.Stringer for Scope. It converts it to the Sysdig format for Scope strings.

type Selector

type Selector string

Selector defines a type for Scope filter operators.

const (
	// SelectionIs filters EventsService.List to Events which do not exactly match the provided value.
	// It is also used to set Scope labels for a created Event.
	SelectionIs Selector = "="
	// SelectionIsNot filters EventsService.List to Events which do not exactly match the provided value.
	SelectionIsNot Selector = "!="
	// SelectionIn filters EventsService.List to Events which exactly match one of the provided values.
	SelectionIn Selector = "in"
	// SelectionNotIn filters EventsService.List to Events which do not exactly match one of the provided values.
	SelectionNotIn Selector = "not in"
	// SelectionContains filters EventsService.List to Events which substring match the provided value.
	SelectionContains Selector = "contains"
	// SelectionDoesNotContain filters EventsService.List to Events which do not substring match the provided value.
	SelectionDoesNotContain Selector = "does not contain"
	// SelectionStartsWith filters EventsService.List to Events which are prefixed with the provided value.
	SelectionStartsWith Selector = "starts with"
)

Jump to

Keyboard shortcuts

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