istio: istio.io/istio/pkg/test/conformance/constraint Index | Files

package constraint

import "istio.io/istio/pkg/test/conformance/constraint"

Index

Package Files

any.go check.go collection.go constraints.go empty.go equals.go exactlyone.go instance.go params.go range.go select.go

type Any Uses

type Any struct {
    Constraints []Check
}

Any item must match check Constraints

func (*Any) ValidateItems Uses

func (e *Any) ValidateItems(arr []interface{}, p Params) error

ValidateItems implements Range

type Check Uses

type Check interface {
    ValidateItem(i interface{}, p Params) error
}

Check a single item for validation purposes.

type Collection Uses

type Collection struct {
    Name  string  `json:"collection"`
    Check []Range `json:"check"`
}

Collection is a set of checks against a collection.

func (*Collection) UnmarshalJSON Uses

func (c *Collection) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Constraints Uses

type Constraints struct {
    Constraints []*Collection `json:"constraints"`
}

Constraints that needs to be satisfied.

func Parse Uses

func Parse(yamlBytes []byte) (*Constraints, error)

Parse the given yaml bytes as a Constraint

type Empty Uses

type Empty struct {
}

Empty means the collection must be empty.

func (*Empty) ValidateItems Uses

func (e *Empty) ValidateItems(arr []interface{}, p Params) error

ValidateItems implements Range

type Equals Uses

type Equals struct {
    Baseline interface{}
}

Equals checks for JSON based equality.

func (*Equals) UnmarshalJSON Uses

func (e *Equals) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Equals) ValidateItem Uses

func (e *Equals) ValidateItem(i interface{}, p Params) error

ValidateItem implements Check

type ExactlyOne Uses

type ExactlyOne struct {
    Constraints []Check
}

ExactlyOne item in a collection must match all check Constraints

func (*ExactlyOne) ValidateItems Uses

func (e *ExactlyOne) ValidateItems(arr []interface{}, p Params) error

ValidateItems implements Range

type Instance Uses

type Instance interface {
    Check(i interface{}) error
}

Instance is a constraint instance that can validate a given resource.

type Params Uses

type Params struct {
    Namespace string
}

Params is a set of parameters to apply to templatized fields

type Range Uses

type Range interface {
    ValidateItems(arr []interface{}, p Params) error
}

Range is a check against a group of items.

type Select Uses

type Select struct {
    Expression string
    Op         SelectOp
    Arg        interface{}

    Children []*Select
    Parent   *Select
}

Select using structpath and apply specified operation.

func (*Select) UnmarshalJSON Uses

func (s *Select) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Select) ValidateItem Uses

func (s *Select) ValidateItem(i interface{}, p Params) error

ValidateItem implements Check

type SelectOp Uses

type SelectOp string

SelectOp is the operation that needs to be performed.

const (
    // SelectGroup indicates that this select is a grouping construct for its children
    SelectGroup SelectOp = "group"

    // SelectEquals applies the equals operation
    SelectEquals SelectOp = "equals"

    // SelectExists applies the exists operation
    SelectExists SelectOp = "exists"

    // SelectNotExists applies the not exists operation
    SelectNotExists SelectOp = "notExists"
)

Package constraint imports 10 packages (graph) and is imported by 2 packages. Updated 2019-07-01. Refresh now. Tools for package owners.