networkcfg

package
v0.0.0-...-48104ab Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCfg

type AgentCfg struct {
	Name            string
	Type            AgentType
	ControlUnitName string
	WorkerDisk      types.MByte
	WorkerMFlops    types.MFlop
	PricePerTick    float64

	Node *NodeCfg // parent
}

AgentCfg is a struct needed to create new agent.Agent instance

type AgentCfgYAML

type AgentCfgYAML struct {
	Name         string
	Type         string
	ControlUnit  string  `yaml:"control_unit,omitempty"`
	WorkerDisk   int     `yaml:"worker_disk,omitempty"`
	WorkerMFlops int     `yaml:"worker_mflops,omitempty"`
	PricePerTick float64 `yaml:"price_per_tick,omitempty"`
}

AgentCfgYAML is a representation of agent section in YAML infrastructure file

func (AgentCfgYAML) Parse

func (agentYAML AgentCfgYAML) Parse(parent *NodeCfg) *AgentCfg

Parse transform unmarshalled config to internal config representation all validations must be performed on this stage

type AgentType

type AgentType int

AgentType is an enum for agent types

const (
	AgentCore AgentType = iota
	AgentControlUnit
	AgentWorker
	AgentDummy
)

AgentType is an enum for agent types

type NetworkCfg

type NetworkCfg struct {
	Name     string
	Segments []*SegmentCfg

	Nodes  []*NodeCfg  // all nodes inside network
	Agents []*AgentCfg // all agents inside network
}

NetworkCfg is a struct needed to create new network.Network instance

func Load

func Load(configFilename string) *NetworkCfg

Load parses network configuration from yaml file

type NodeCfg

type NodeCfg struct {
	Name   string
	Agents []*AgentCfg

	Segment *SegmentCfg // parent
}

NodeCfg is a struct needed to create new network.Node instance

type NodeCfgYAML

type NodeCfgYAML struct {
	Name   string
	Agents []AgentCfgYAML
}

NodeCfgYAML is a representation of network node section in YAML infrastructure file

func (NodeCfgYAML) Parse

func (nodeYAML NodeCfgYAML) Parse(parent *SegmentCfg) *NodeCfg

Parse transform unmarshalled config to internal config representation all validations must be performed on this stage

type SegmentCfg

type SegmentCfg struct {
	Name          string
	InnerBandwith [2]int
	OuterBandwith [2]int
	Nodes         []*NodeCfg

	Network *NetworkCfg // parent

	Agents []*AgentCfg // all agents inside segment
}

SegmentCfg is a struct needed to create new network.Segment instance

type SegmentCfgYAML

type SegmentCfgYAML struct {
	Name          string
	InnerBandwith []int `yaml:"inner_bandwith,flow"`
	OuterBandwith []int `yaml:"outer_bandwith,flow"`
	Nodes         []NodeCfgYAML
}

SegmentCfgYAML is a representation of network segment section in YAML infrastructure file

func (SegmentCfgYAML) Parse

func (segmentYAML SegmentCfgYAML) Parse(parent *NetworkCfg) *SegmentCfg

Parse transform unmarshalled config to internal config representation all validations must be performed on this stage

type YAML

type YAML struct {
	Name     string
	Segments []SegmentCfgYAML
}

YAML is a representation of network section in YAML infrastructure file

func (YAML) Parse

func (networkYAML YAML) Parse() *NetworkCfg

Parse transform unmarshalled config to internal config representation all validations must be performed on this stage

Jump to

Keyboard shortcuts

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