Documentation ¶
Index ¶
- Variables
- type Config
- type ENC
- func (enc *ENC) AddClass(nodegroupName string, key string) (*Nodegroup, error)
- func (enc *ENC) AddClassParameter(nodegroupName string, class string, key string, val interface{}) (*Nodegroup, error)
- func (enc *ENC) AddNode(nodegroup string, nodeName string) (*Nodegroup, error)
- func (enc *ENC) AddNodegroup(name string, parent string, classes map[string]interface{}, nodes []string, ...) (*Nodegroup, error)
- func (enc *ENC) AddNodes(nodegroup string, nodes []string) (*Nodegroup, error)
- func (enc *ENC) AddParameter(nodegroupName string, key string, val interface{}) (*Nodegroup, error)
- func (enc *ENC) ConflictMerge(nodegroups []*Nodegroup) (*Nodegroup, error)
- func (enc *ENC) GetChains(nodeName string) ([]string, error)
- func (enc *ENC) GetNode(nodeName string) (*Nodegroup, error)
- func (enc *ENC) GetNodegroup(nodegroupName string) (*Nodegroup, error)
- func (enc *ENC) ParentChainWrapper(nodegroupName string) []string
- func (enc *ENC) RemoveClass(nodegroupName string, key string) (*Nodegroup, error)
- func (enc *ENC) RemoveClassParameter(nodegroupName string, class string, key string) (*Nodegroup, error)
- func (enc *ENC) RemoveNode(nodegroup string, nodeName string) (*Nodegroup, error)
- func (enc *ENC) RemoveNodegroup(name string) (*Nodegroup, error)
- func (enc *ENC) RemoveParameter(nodegroupName string, key string) (*Nodegroup, error)
- func (enc *ENC) SetClassParameter(nodegroupName string, class string, key string, val interface{}) (*Nodegroup, error)
- func (enc *ENC) SetEnvironment(nodegroupName string, env string) (*Nodegroup, error)
- func (enc *ENC) SetParameter(nodegroupName string, key string, val interface{}) (*Nodegroup, error)
- func (enc *ENC) SetParent(nodegroupName string, parent string) (*Nodegroup, error)
- type Nodegroup
Constants ¶
This section is empty.
Variables ¶
var (
CHAIN_SEPARATION_CHARACTER = "$$"
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config stores the configuration for our ENC
func NewConfig ¶
NewConfig generates a new ENC from the config. One ENC for each file matched by the glob pattern
func (*Config) WriteOutENC ¶ added in v1.1.0
func (c *Config) WriteOutENC()
type ENC ¶
type ENC struct { Name string Nodegroups map[string]Nodegroup Nodes *trie.Trie ConfigType string FileName string ConfigLink *Config }
ENC represents the entire structure of the External Node Classifier
func (*ENC) AddClassParameter ¶
func (enc *ENC) AddClassParameter(nodegroupName string, class string, key string, val interface{}) (*Nodegroup, error)
AddClassParameter adds a parameter to a given class on a nodegroup
func (*ENC) AddNodegroup ¶
func (enc *ENC) AddNodegroup(name string, parent string, classes map[string]interface{}, nodes []string, params map[string]interface{}) (*Nodegroup, error)
AddNodegroup adds a Nodegroup to the ENC
func (*ENC) AddParameter ¶
AddParameter add a parameter to a nodegroup
func (*ENC) ConflictMerge ¶ added in v1.2.0
func (*ENC) GetNodegroup ¶
GetNodegroup retrieves a nodegroup by name
func (*ENC) ParentChainWrapper ¶ added in v1.2.0
func (*ENC) RemoveClass ¶
RemoveClass removes a class from a nodegroup
func (*ENC) RemoveClassParameter ¶
func (enc *ENC) RemoveClassParameter(nodegroupName string, class string, key string) (*Nodegroup, error)
RemoveClassParameter removes a parameter from a class
func (*ENC) RemoveNode ¶
RemoveNode removes a single node from a nodegroup
func (*ENC) RemoveNodegroup ¶
RemoveNodegroup removes a nodegroup from the ENC
func (*ENC) RemoveParameter ¶
RemoveParameter removes a parameter from a nodegroup
func (*ENC) SetClassParameter ¶
func (enc *ENC) SetClassParameter(nodegroupName string, class string, key string, val interface{}) (*Nodegroup, error)
SetClassParameter is an alias for AddClassParameter
func (*ENC) SetEnvironment ¶
SetEnvironment sets the value of the environment of a nodegroup
func (*ENC) SetParameter ¶
SetParameter is an alias for AddParameter
type Nodegroup ¶
type Nodegroup struct { Parent string `json:"parent,omitempty" yaml:"parent,omitempty"` Classes map[string]interface{} `json:"classes,omitempty" yaml:"classes,omitempty"` Nodes []string `json:"nodes,omitempty" yaml:"nodes,omitempty"` Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` }
Nodegroup represents groups of nodes and meta information about them