diffgraph

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChangeRuleActionUpsert ChangeRuleAction = "upsert"
	ChangeRuleActionDelete ChangeRuleAction = "delete"

	ChangeRuleOrderBefore ChangeRuleOrder = "before"
	ChangeRuleOrderAfter  ChangeRuleOrder = "after"

	ChangeRuleTargetActionUpserting ChangeRuleTargetAction = "upserting"
	ChangeRuleTargetActionDeleting  ChangeRuleTargetAction = "deleting"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActualChange

type ActualChange interface {
	Resource() ctlres.Resource
	Op() ActualChangeOp
}

type ActualChangeOp

type ActualChangeOp string
const (
	ActualChangeOpUpsert ActualChangeOp = "upsert"
	ActualChangeOpDelete ActualChangeOp = "delete"
	ActualChangeOpNoop   ActualChangeOp = "noop"
)

type BlockedChanges

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

func NewBlockedChanges

func NewBlockedChanges(graph *ChangeGraph) *BlockedChanges

func (*BlockedChanges) Blocked

func (c *BlockedChanges) Blocked() []*Change

func (*BlockedChanges) Unblock

func (c *BlockedChanges) Unblock(change *Change)

func (*BlockedChanges) Unblocked

func (c *BlockedChanges) Unblocked() []*Change

func (*BlockedChanges) WhyBlocked

func (c *BlockedChanges) WhyBlocked(changes []*Change) string

type Change

type Change struct {
	Change     ActualChange
	WaitingFor []*Change
	// contains filtered or unexported fields
}

func (*Change) AllRules

func (c *Change) AllRules() ([]ChangeRule, error)

func (*Change) ApplicableRules

func (c *Change) ApplicableRules() ([]ChangeRule, error)

func (*Change) Groups

func (c *Change) Groups() ([]ChangeGroup, error)

type ChangeDefaults

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

func (ChangeDefaults) AllRules

func (d ChangeDefaults) AllRules() ([]ChangeRule, error)

func (ChangeDefaults) Groups

func (d ChangeDefaults) Groups() ([]ChangeGroup, error)

type ChangeGraph

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

func NewChangeGraph

func NewChangeGraph(changes []ActualChange) (*ChangeGraph, error)

func (*ChangeGraph) All

func (g *ChangeGraph) All() []*Change

func (*ChangeGraph) AllMatching

func (g *ChangeGraph) AllMatching(matchFunc func(*Change) bool) []*Change

func (*ChangeGraph) Print

func (g *ChangeGraph) Print()

func (*ChangeGraph) PrintStr

func (g *ChangeGraph) PrintStr() string

func (*ChangeGraph) RemoveMatching

func (g *ChangeGraph) RemoveMatching(matchFunc func(*Change) bool)

type ChangeGroup

type ChangeGroup struct {
	Name string
}

func MustNewChangeGroupFromAnnString

func MustNewChangeGroupFromAnnString(ann string) ChangeGroup

func NewChangeGroupFromAnnString

func NewChangeGroupFromAnnString(ann string) (ChangeGroup, error)

func (ChangeGroup) IsEqual

func (r ChangeGroup) IsEqual(other ChangeGroup) bool

func (ChangeGroup) Validate

func (r ChangeGroup) Validate() error

type ChangeRule

type ChangeRule struct {
	Action       ChangeRuleAction
	Order        ChangeRuleOrder
	TargetAction ChangeRuleTargetAction
	TargetGroup  ChangeGroup
}

Example: upsert before deleting apps.big.co/etcd

func NewChangeRuleFromAnnString

func NewChangeRuleFromAnnString(ann string) (ChangeRule, error)

func (ChangeRule) Validate

func (r ChangeRule) Validate() error

type ChangeRuleAction

type ChangeRuleAction string

type ChangeRuleOrder

type ChangeRuleOrder string

type ChangeRuleTargetAction

type ChangeRuleTargetAction string

type Changes

type Changes []*Change

func (Changes) MatchesRule

func (cs Changes) MatchesRule(rule ChangeRule, exceptChange *Change) ([]*Change, error)

Jump to

Keyboard shortcuts

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