rules

package
v0.0.0-...-ed9dbbb Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const RuleMatchesHashTag = "__rule-matches-hash__"

Variables

This section is empty.

Functions

This section is empty.

Types

type FromRules

type FromRules struct {
	Rules map[InboundListener]Rules
}

type GatewayRules

type GatewayRules struct {
	ToRules   map[InboundListener]Rules
	FromRules map[InboundListener]Rules
}

type InboundListener

type InboundListener struct {
	Address string
	Port    uint32
}

func (InboundListener) MarshalText

func (i InboundListener) MarshalText() ([]byte, error)

func (InboundListener) String

func (i InboundListener) String() string

type PolicyItemWithMeta

type PolicyItemWithMeta struct {
	core_model.PolicyItem
	core_model.ResourceMeta
}

type Rule

type Rule struct {
	Subset Subset
	Conf   interface{}
	Origin []core_model.ResourceMeta
}

Rule contains a configuration for the given Subset. When rule is an inbound rule (from), then Subset represents a group of clients. When rule is an outbound (to) then Subset represents destinations.

type Rules

type Rules []*Rule

type SingleItemRules

type SingleItemRules struct {
	Rules Rules
}

type Subset

type Subset []Tag

Subset represents a group of proxies

func MeshService

func MeshService(name string) Subset

func MeshSubset

func MeshSubset() Subset

func SubsetFromTags

func SubsetFromTags(tags map[string]string) Subset

func (Subset) IndexOfPositive

func (ss Subset) IndexOfPositive() int

func (Subset) Intersect

func (ss Subset) Intersect(other Subset) bool

Intersect returns true if there exists an element that belongs both to 'other' and current set. Empty set intersects with all sets.

func (Subset) IsSubset

func (ss Subset) IsSubset(other Subset) bool

IsSubset returns true if 'other' is a subset of the current set. Empty set is a superset for all subsets.

func (Subset) NumPositive

func (ss Subset) NumPositive() int

NumPositive returns a number of tags without negation

func (Subset) WithTag

func (ss Subset) WithTag(key, value string, not bool) Subset

type Tag

type Tag struct {
	Key   string
	Value string
	Not   bool
}

Tag is a key-value pair. If Not is true then Key != Value

type ToRules

type ToRules struct {
	Rules Rules
}

Jump to

Keyboard shortcuts

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