ccsyntax

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValueKey = "VALUE"
	IndexKey = "INDEX"
	KeyKey   = "KEY"
)

Variables

This section is empty.

Functions

func NewParser

func NewParser(cfg *ctrlcfgv1.ControllerConfig) (Parser, []Result)

Types

type ConfigExecutionContext

type ConfigExecutionContext interface {
	GetName() string
	Add(oc *OriginContext) error
	AddBlock(oc *OriginContext) error
	GetDAG(oc *OriginContext) rtdag.RuntimeDAG
	GetDAGCtx(fow FOW, gvk *schema.GroupVersionKind, op Operation) *RTDAGCtx
	GetFOW(fow FOW) map[schema.GroupVersionKind]OperationCtx
	GetForGVK() *schema.GroupVersionKind
	Print()
}

func NewConfigExecutionContext

func NewConfigExecutionContext(n string) ConfigExecutionContext

type FOW

type FOW string
const (
	FOWFor   FOW = "for"
	FOWOwn   FOW = "own"
	FOWWatch FOW = "watch"
)

type FOWEntry

type FOWEntry struct {
	FOW            FOW
	RootVertexName string
}

type GlobalVariable

type GlobalVariable interface {
	GetName() string
	Add(fe FOWEntry)
	GetDAG(fe FOWEntry) vardag.VarDAG
	Print()
}

GlobalVariable stores the variable context in a global DAG for validating that the variables are globally unique. This is only used by the parser for resolving and connecting the runtime graph

func NewGlobalVariable

func NewGlobalVariable(n string) GlobalVariable

type Operation

type Operation string
const (
	OperationApply  Operation = "apply"
	OperationDelete Operation = "delete"
	OperationNone   Operation = "none"
)

type OperationCtx

type OperationCtx map[Operation]*RTDAGCtx

type Origin

type Origin string
const (
	OriginInvalid  Origin = "invalid"
	OriginFow      Origin = "fow"
	OriginVariable Origin = "vars"
	OriginFunction Origin = "function"
	OriginService  Origin = "services"
)

type OriginContext

type OriginContext struct {
	//Index      int
	FOW             FOW                      `json:"fow,omitempty" yaml:"fow,omitempty"`
	RootVertexName  string                   `json:"rootVertexName,omitempty" yaml:"rootVertexName,omitempty"`
	GVK             *schema.GroupVersionKind `json:"gvk,omitempty" yaml:"gvk,omitempty"`
	Operation       Operation                `json:"operation,omitempty" yaml:"operation,omitempty"`
	Pipeline        string                   `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
	Origin          Origin                   `json:"origin,omitempty" yaml:"origin,omitempty"`
	Block           bool                     `json:"block,omitempty" yaml:"block,omitempty"`
	BlockIndex      int                      `json:"blockIdx,omitempty" yaml:"blockIdx,omitempty"`
	BlockVertexName string                   `json:"blockVertexName,omitempty" yaml:"blockVertexName,omitempty"`
	VertexName      string                   `json:"vertexname,omitempty" yaml:"vertexname,omitempty"`
	LocalVarName    string                   `json:"localvarName,omitempty" yaml:"localvarName,omitempty"`
	LocalVars       map[string]string        `json:"localVars,omitempty" yaml:"localvarName,omitempty"`
}

func (*OriginContext) DeepCopy

func (in *OriginContext) DeepCopy() *OriginContext

func (*OriginContext) DeepCopyInto

func (in *OriginContext) DeepCopyInto(out *OriginContext)

type Parser

type Parser interface {
	GetExternalResources() ([]*schema.GroupVersionKind, []Result)
	Parse() (ConfigExecutionContext, []Result)
}

type RTDAGCtx

type RTDAGCtx struct {
	DAG            rtdag.RuntimeDAG
	RootVertexName string

	BlockDAGs map[string]rtdag.RuntimeDAG
	// contains filtered or unexported fields
}

type Reference

type Reference struct {
	Kind  ReferenceKind
	Value string
}

type ReferenceKind

type ReferenceKind string
const (
	RangeReferenceKind   ReferenceKind = "range" // used for $KEY, $VALUE, $INDEX
	RegularReferenceKind ReferenceKind = "regular"
)

type References

type References interface {
	GetReferences(s string) []*Reference
}

func NewReferences

func NewReferences() References

type Result

type Result struct {
	OriginContext *OriginContext `json:"inline" yaml:"inline"`
	Error         string         `json:"error,omitempty" yaml:"error,omitempty"`
}

type VariableContext

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

func (*VariableContext) Add

func (r *VariableContext) Add(fe FOWEntry)

func (*VariableContext) GetDAG

func (r *VariableContext) GetDAG(fe FOWEntry) vardag.VarDAG

func (*VariableContext) GetName

func (r *VariableContext) GetName() string

func (*VariableContext) Print

func (r *VariableContext) Print()

type WalkConfig

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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