commit

package
v0.0.0-...-fc2a63e Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: BSD-3-Clause, MPL-2.0 Imports: 12 Imported by: 2

README

golang-vyatta-configd-commit

This library deals with building priority trees and other tasks required for handling non-VCI commits.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Changed

func Changed(ctx Context) bool

func Commit

func Commit(ctx Context) ([]*exec.Output, []error, int, int)

func Validate

func Validate(ctx Context) ([]*exec.Output, []error, bool)

Types

type CfgNode

type CfgNode struct {
	*diff.Node
	Path        []string
	Parent      *CfgNode
	CfgChildren []*CfgNode
	SubChanged  bool
	// contains filtered or unexported fields
}

func (*CfgNode) BeginEnd

func (c *CfgNode) BeginEnd() bool

func (*CfgNode) Changed

func (c *CfgNode) Changed() bool

func (*CfgNode) Delete

func (c *CfgNode) Delete() ([]*exec.Output, []error, bool)

func (*CfgNode) DeleteChild

func (c *CfgNode) DeleteChild(ch *CfgNode)

func (*CfgNode) DeleteLeaf

func (c *CfgNode) DeleteLeaf() ([]*exec.Output, []error, bool)

func (*CfgNode) DeleteList

func (c *CfgNode) DeleteList() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecActs

func (c *CfgNode) ExecActs(acts []string, action string) ([]*exec.Output, []error, bool)

func (*CfgNode) ExecBegin

func (c *CfgNode) ExecBegin() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecCreate

func (c *CfgNode) ExecCreate() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecDelete

func (c *CfgNode) ExecDelete() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecEnd

func (c *CfgNode) ExecEnd() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecRegisterDefer

func (c *CfgNode) ExecRegisterDefer() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecUpdate

func (c *CfgNode) ExecUpdate() ([]*exec.Output, []error, bool)

func (*CfgNode) ExecValidate

func (c *CfgNode) ExecValidate() ([]*exec.Output, []error, bool)

func (*CfgNode) GetAddedValues

func (c *CfgNode) GetAddedValues() []string

func (*CfgNode) GetDeletedValues

func (c *CfgNode) GetDeletedValues() []string

func (*CfgNode) GetValues

func (c *CfgNode) GetValues() []string

func (*CfgNode) IsIgnore

func (c *CfgNode) IsIgnore() bool

Ignore interfaces are for detecting descendants added to the commit tree. These descendants are added to restore running action scripts on list key nodes which existing users depend on.

Yes, this is a cludge.

func (*CfgNode) IsLeaf

func (c *CfgNode) IsLeaf() bool

func (*CfgNode) IsLeafList

func (c *CfgNode) IsLeafList() bool

func (*CfgNode) IsLeafValue

func (c *CfgNode) IsLeafValue() bool

func (*CfgNode) IsList

func (c *CfgNode) IsList() bool

func (*CfgNode) IsListEntry

func (c *CfgNode) IsListEntry() bool

func (*CfgNode) PostOrder

func (c *CfgNode) PostOrder() []*CfgNode

func (*CfgNode) PostOrderFilterBE

func (c *CfgNode) PostOrderFilterBE() []*CfgNode

func (*CfgNode) PreOrder

func (c *CfgNode) PreOrder() []*CfgNode

func (*CfgNode) PreOrderFilterBE

func (c *CfgNode) PreOrderFilterBE() []*CfgNode

func (*CfgNode) SetIgnore

func (c *CfgNode) SetIgnore(i bool)

func (*CfgNode) SetSubtreeChanged

func (c *CfgNode) SetSubtreeChanged()

func (*CfgNode) Update

func (c *CfgNode) Update() ([]*exec.Output, []error, bool)

func (*CfgNode) UpdateLeaf

func (c *CfgNode) UpdateLeaf() ([]*exec.Output, []error, bool)

func (*CfgNode) UpdateLeafList

func (c *CfgNode) UpdateLeafList() ([]*exec.Output, []error, bool)

func (*CfgNode) UpdateList

func (c *CfgNode) UpdateList() ([]*exec.Output, []error, bool)

func (*CfgNode) Validate

func (c *CfgNode) Validate(
	compMgr schema.ComponentManager,
) ([]*exec.Output, []error, bool)

func (*CfgNode) ValidateExec

func (c *CfgNode) ValidateExec() ([]*exec.Output, []error, bool)

type ComponentContext

type ComponentContext interface {
	CompMgr() schema.ComponentManager
}

type Context

type Context interface {
	Log(...interface{})
	LogError(...interface{})
	LogCommitMsg(string)
	LogCommitTime(string, time.Time)
	LogAudit(string)
	Debug() bool
	MustDebugThreshold() int
	Sid() string
	Uid() uint32
	Running() *data.Node
	Candidate() *data.Node
	Schema() schema.Node
	RunDeferred() bool
	Effective() EffectiveDatabase
}

type EffectiveDatabase

type EffectiveDatabase interface {
	Set([]string) error
	Delete([]string) error
}

type MaxHeap

type MaxHeap struct {
	PrioNodes
}

func (MaxHeap) Less

func (heap MaxHeap) Less(i, j int) bool

type MinHeap

type MinHeap struct {
	PrioNodes
}

type PrioNode

type PrioNode struct {
	Priority uint
	Cfg      *CfgNode
	Parent   *PrioNode
	Children PrioNodes
}

func (*PrioNode) RunDeleteActions

func (pnode *PrioNode) RunDeleteActions(ctx Context) ([]*exec.Output, []error, bool)

func (*PrioNode) RunUpdateActions

func (pnode *PrioNode) RunUpdateActions(ctx Context) ([]*exec.Output, []error, bool)

func (*PrioNode) SetChanged

func (pnode *PrioNode) SetChanged()

type PrioNodes

type PrioNodes []*PrioNode

func (PrioNodes) Empty

func (pn PrioNodes) Empty() bool

func (PrioNodes) Len

func (pn PrioNodes) Len() int

func (PrioNodes) Less

func (pn PrioNodes) Less(i, j int) bool

func (*PrioNodes) Pop

func (pn *PrioNodes) Pop() interface{}

func (*PrioNodes) Push

func (pn *PrioNodes) Push(x interface{})

func (PrioNodes) Swap

func (pn PrioNodes) Swap(i, j int)

Jump to

Keyboard shortcuts

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