selectors

package
v0.25.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Companion package for github.com/fluxninja/aperture/api/gen/proto/go/aperture/policy/language/v1 containing conversions of proto-generated struct into golang ones and other helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromProto

func FromProto(selectorMsg *policylangv1.FlowSelector) (selector, error)

FromProto creates a Selector from a "raw" proto-based Selector

The selector is assumed to be already validated and non-nil.

func MMExprFromLabelMatcher

func MMExprFromLabelMatcher(lm *policylangv1.LabelMatcher) (mm.Expr, error)

MMExprFromLabelMatcher translates proto definition of label matcher into a // single multimatcher expression

LabelMatcher can be nil or a validated LabelMatcher.

func MMExprFromProto

func MMExprFromProto(expr *policylangv1.MatchExpression) (mm.Expr, error)

MMExprFromProto converts proto definition of expression into multimatcher Expression

The expr is assumed to be validated and nonnil.

Types

type ControlPointID

type ControlPointID struct {
	Service      string
	ControlPoint string
}

ControlPointID is the struct that represents a ControlPoint.

Agent group is implied.

Note: We need to mirror cmdv1.ServiceControlPoint, because protobuf-generated struct cannot be used as map keys.

func ControlPointIDFromProto added in v0.25.0

func ControlPointIDFromProto(protoCP *cmdv1.ServiceControlPoint) ControlPointID

ControlPointIDFromProto creates ControlPointID from protobuf representation.

func NewControlPointID

func NewControlPointID(service string, controlPoint string) ControlPointID

NewControlPointID returns a controlPointID.

func (ControlPointID) InAgentGroup added in v0.25.0

func (cp ControlPointID) InAgentGroup(agentGroup string) GlobalControlPointID

InAgentGroup returns the controlpoint as GlobalControlPointID with given agent group.

func (*ControlPointID) ToProto added in v0.25.0

func (cp *ControlPointID) ToProto() *cmdv1.ServiceControlPoint

ToProto returns protobuf representation of control point.

type GlobalControlPointID added in v0.25.0

type GlobalControlPointID struct {
	ControlPointID
	AgentGroup string
}

GlobalControlPointID is ControlPointID with explicit agent group.

Note: We need to mirror cmdv1.ServiceControlPoint, because protobuf-generated struct cannot be used as map keys.

func GlobalControlPointIDFromProto added in v0.25.0

func GlobalControlPointIDFromProto(protoCP *cmdv1.GlobalServiceControlPoint) GlobalControlPointID

GlobalControlPointIDFromProto creates ControlPointID from protobuf representation.

func (*GlobalControlPointID) ToProto added in v0.25.0

ToProto returns protobuf representation of control point.

Jump to

Keyboard shortcuts

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