Documentation
¶
Index ¶
- Constants
- func ActiveInstanceId() string
- func ActiveInstancePath() string
- func AddBootstrapExtension(ext BootstrapExtension)
- func AllocateDump(run string) string
- func AllocateForensicScenario(run, scenario string) string
- func Bootstrap() error
- func BootstrapBindings() error
- func BootstrapInstance() error
- func ClearActiveInstance() error
- func ConfigBuild() string
- func ConfigSrc() string
- func CreateLabel(instanceId, modelName string) error
- func FablabRoot() string
- func InitInstanceId(newInstanceId string)
- func KitBuild() string
- func ListDumps() ([]string, error)
- func ListInstances() ([]string, error)
- func ListModels() []string
- func NewInstance() (string, error)
- func NewNamedInstance(name string) error
- func PkiBuild() string
- func RegisterModel(name string, m *Model)
- func RemoveInstance(instanceId string) error
- func ScriptBuild() string
- func ScriptSrc() string
- func Selector(levels ...string) string
- func SetActiveInstance(newInstanceId string) error
- func ValidateModelName(modelName string) error
- type Action
- type ActionBinder
- type ActionBinders
- type ActionFunc
- type ActivationStage
- type ActivationStages
- type Bindings
- func (bindings Bindings) Get(name ...string) (interface{}, bool)
- func (bindings Bindings) GetBool(name ...string) (bool, bool)
- func (bindings Bindings) GetString(name ...string) (string, bool)
- func (bindings Bindings) Has(name ...string) bool
- func (bindings Bindings) Must(name ...string) interface{}
- func (bindings Bindings) Put(value interface{}, rootKey string, rest ...string)
- type BootstrapExtension
- type Component
- func (component *Component) Accept(visitor EntityVisitor)
- func (component *Component) GetChildren() []Entity
- func (component *Component) GetHost() *Host
- func (component *Component) GetId() string
- func (component *Component) GetModel() *Model
- func (component *Component) GetParentEntity() Entity
- func (component *Component) GetPath() string
- func (component *Component) GetRegion() *Region
- func (component *Component) GetScope() *Scope
- func (component *Component) GetType() string
- func (component *Component) Matches(entityType string, matcher EntityMatcher) bool
- func (c *Component) Merge(parent *Component) (*Component, error)
- func (component *Component) Region() *Region
- type ComponentDump
- type Components
- type ConfigurationStage
- type ConfigurationStages
- type CpuTimeslice
- type Data
- type DataMetricsWriter
- type DisposalStage
- type DisposalStages
- type DistributionStage
- type DistributionStages
- type Dump
- type Entity
- type EntityMatcher
- type EntityVisitor
- type Factory
- type Host
- func (host *Host) Accept(visitor EntityVisitor)
- func (host *Host) GetChildren() []Entity
- func (host *Host) GetId() string
- func (host *Host) GetModel() *Model
- func (host *Host) GetParentEntity() Entity
- func (host *Host) GetPath() string
- func (host *Host) GetRegion() *Region
- func (host *Host) GetScope() *Scope
- func (host *Host) GetType() string
- func (host *Host) Matches(entityType string, matcher EntityMatcher) bool
- func (h *Host) Merge(parent *Host) (*Host, error)
- type HostDump
- type HostSummary
- type Hosts
- type InfrastructureStage
- type InfrastructureStages
- type InstanceState
- type IperfSummary
- type IperfTimeslice
- type IperfUdpSummary
- type IperfUdpTimeslice
- type Label
- type MemoryTimeslice
- type MetricSet
- type MetricsEvent
- type MetricsHandler
- type Model
- func (m *Model) Accept(visitor EntityVisitor)
- func (m *Model) AcceptHostMetrics(host *Host, event *MetricsEvent)
- func (m *Model) Activate(run Run) error
- func (m *Model) AddActivationActions(actions ...string)
- func (m *Model) AddActivationStage(stage ActivationStage)
- func (m *Model) AddActivationStages(stage ...ActivationStage)
- func (m *Model) AddOperatingActions(actions ...string)
- func (m *Model) AddOperatingStage(stage OperatingStage)
- func (m *Model) AddOperatingStages(stages ...OperatingStage)
- func (m *Model) BindBindings(bindings Bindings) error
- func (m *Model) BindLabel(l *Label)
- func (m *Model) Build(run Run) error
- func (m *Model) Dispose(run Run) error
- func (m *Model) Dump() *Dump
- func (m *Model) Express(run Run) error
- func (m *Model) ForEachComponent(spec string, concurrency int, f func(c *Component) error) error
- func (m *Model) ForEachHost(spec string, concurrency int, f func(host *Host) error) error
- func (m *Model) GetAction(name string) (Action, bool)
- func (m *Model) GetChildren() []Entity
- func (m *Model) GetId() string
- func (m *Model) GetModel() *Model
- func (m *Model) GetParentEntity() Entity
- func (m *Model) GetRequiredStringVariable(holder errorz.ErrorHolder, name ...string) string
- func (m *Model) GetScope() *Scope
- func (m *Model) GetType() string
- func (m *Model) GetVariable(name ...string) (interface{}, bool)
- func (m *Model) IsBound() bool
- func (m *Model) IterateScopes(f func(i interface{}, path ...string))
- func (m *Model) Matches(entityType string, matcher EntityMatcher) bool
- func (m *Model) Merge(parent *Model) error
- func (m *Model) MustSelectHost(spec string) *Host
- func (m *Model) MustSelectHosts(spec string, minCount int) ([]*Host, error)
- func (m *Model) MustSelectRegion(spec string) *Region
- func (m *Model) MustStringVariable(name ...string) string
- func (m *Model) MustVariable(name ...string) interface{}
- func (m *Model) Operate(run Run) error
- func (m *Model) SelectComponent(spec string) (*Component, error)
- func (m *Model) SelectComponents(spec string) []*Component
- func (m *Model) SelectHost(spec string) (*Host, error)
- func (m *Model) SelectHosts(spec string) []*Host
- func (m *Model) SelectRegion(spec string) (*Region, error)
- func (m *Model) SelectRegions(spec string) []*Region
- func (m *Model) Sync(run Run) error
- type OperatingStage
- type OperatingStages
- type ProcessTimeslice
- type Region
- func (region *Region) Accept(visitor EntityVisitor)
- func (region *Region) GetChildren() []Entity
- func (region *Region) GetId() string
- func (region *Region) GetModel() *Model
- func (region *Region) GetParentEntity() Entity
- func (region *Region) GetScope() *Scope
- func (region *Region) GetType() string
- func (region *Region) Matches(entityType string, matcher EntityMatcher) bool
- func (r *Region) Merge(parent *Region) (*Region, error)
- func (region *Region) SelectHosts(hostSpec string) map[string]*Host
- type RegionDump
- type Regions
- type Run
- type Scope
- type ScopeDump
- type StdOutMetricsWriter
- type Tags
- type Variable
- type VariableDump
- type Variables
- type ZitiFabricLinkMetricsSummary
- type ZitiFabricLinkSummary
- type ZitiFabricMeshSummary
- type ZitiFabricRouterMetricsSummary
Constants ¶
View Source
const ( EntityTypeModel = "model" EntityTypeRegion = "region" EntityTypeHost = "host" EntityTypeComponent = "component" )
View Source
const ( SelectorTagPrefix = "." SelectorIdPrefix = "#" )
View Source
const (
InheritTagPrefix = "^"
)
View Source
const Version = "0.3.6 (sp1r4l)"
Variables ¶
This section is empty.
Functions ¶
func ActiveInstanceId ¶
func ActiveInstanceId() string
func ActiveInstancePath ¶
func ActiveInstancePath() string
func AddBootstrapExtension ¶
func AddBootstrapExtension(ext BootstrapExtension)
func AllocateDump ¶
func BootstrapBindings ¶
func BootstrapBindings() error
func BootstrapInstance ¶
func BootstrapInstance() error
func ClearActiveInstance ¶
func ClearActiveInstance() error
func ConfigBuild ¶
func ConfigBuild() string
func CreateLabel ¶
func FablabRoot ¶
func FablabRoot() string
func InitInstanceId ¶
func InitInstanceId(newInstanceId string)
func ListInstances ¶
func ListModels ¶
func ListModels() []string
func NewInstance ¶
func NewNamedInstance ¶
func RegisterModel ¶
func RemoveInstance ¶
func ScriptBuild ¶
func ScriptBuild() string
func SetActiveInstance ¶
func ValidateModelName ¶
Types ¶
type ActionBinder ¶
type ActionBinders ¶
type ActionBinders map[string]ActionBinder
type ActionFunc ¶
func (ActionFunc) Execute ¶
func (f ActionFunc) Execute(m *Model) error
type ActivationStage ¶
type ActivationStages ¶
type ActivationStages []ActivationStage
type Bindings ¶
type Bindings map[interface{}]interface{}
func GetBindings ¶
func GetBindings() Bindings
type BootstrapExtension ¶
type Component ¶
type Component struct { Scope Id string Host *Host ScriptSrc string ScriptName string ConfigSrc string ConfigName string BinaryName string PublicIdentity string PrivateIdentity string Index int }
func (*Component) Accept ¶
func (component *Component) Accept(visitor EntityVisitor)
func (*Component) GetChildren ¶
func (*Component) GetParentEntity ¶
type ComponentDump ¶
type ComponentDump struct { Scope *ScopeDump `json:"scope,omitempty"` ScriptSrc string `json:"script_src,omitempty"` ScriptName string `json:"script_name,omitempty"` ConfigSrc string `json:"config_src,omitempty"` ConfigName string `json:"config_name,omitempty"` BinaryName string `json:"binary_name,omitempty"` PublicIdentity string `json:"public_identity,omitempty` PrivateIdentity string `json:"private_identity,omitempty"` }
type Components ¶
func (Components) Merge ¶
func (c Components) Merge(parent Components) (Components, error)
type ConfigurationStage ¶
type ConfigurationStages ¶
type ConfigurationStages []ConfigurationStage
type CpuTimeslice ¶
type CpuTimeslice struct { TimestampMs int64 `json:"timestamp_ms"` PercentUser float64 `json:"percent_user"` PercentNice float64 `json:"percent_nice"` PercentSystem float64 `json:"percent_system"` PercentIowait float64 `json:"percent_iowait"` PercentSteal float64 `json:"percent_steal"` PercentIdle float64 `json:"percent_idle"` }
type DataMetricsWriter ¶
type DataMetricsWriter struct { }
func (DataMetricsWriter) AcceptHostMetrics ¶
func (DataMetricsWriter) AcceptHostMetrics(host *Host, event *MetricsEvent)
type DisposalStage ¶
type DisposalStages ¶
type DisposalStages []DisposalStage
type DistributionStage ¶
type DistributionStages ¶
type DistributionStages []DistributionStage
type Dump ¶
type Dump struct { Scope *ScopeDump `json:"scope,omitempty"` Regions map[string]*RegionDump `json:"regions"` }
type Entity ¶
type Entity interface { GetModel() *Model GetType() string GetId() string GetScope() *Scope GetParentEntity() Entity Accept(EntityVisitor) GetChildren() []Entity Matches(entityType string, matcher EntityMatcher) bool }
type EntityMatcher ¶
func (EntityMatcher) And ¶
func (m EntityMatcher) And(m2 EntityMatcher) EntityMatcher
func (EntityMatcher) Or ¶
func (m EntityMatcher) Or(m2 EntityMatcher) EntityMatcher
type EntityVisitor ¶
type EntityVisitor func(Entity)
type Host ¶
type Host struct { Scope Id string Region *Region PublicIp string PrivateIp string InstanceType string InstanceResourceType string SpotPrice string SpotType string Components Components Index int }
func (*Host) Accept ¶
func (host *Host) Accept(visitor EntityVisitor)
func (*Host) GetChildren ¶
func (*Host) GetParentEntity ¶
type HostDump ¶
type HostDump struct { Scope *ScopeDump `json:"scope,omitempty"` PublicIp string `json:"public_ip,omitempty"` PrivateIp string `json:"private_ip,omitempty"` InstanceType string `json:"instance_type,omitempty"` InstanceResourceType string `json:"instance_resource_type,omitempty"` SpotPrice string `json:"spot_price,omitempty"` SpotType string `json:"spot_type,omitempty"` Components map[string]*ComponentDump `json:"components,omitempty"` }
type HostSummary ¶
type HostSummary struct { Cpu []*CpuTimeslice `json:"cpu,omitempty"` Memory []*MemoryTimeslice `json:"memory,omitempty"` Process []*ProcessTimeslice `json:"process,omitempty"` }
func (*HostSummary) ToMetricsEvents ¶
func (hs *HostSummary) ToMetricsEvents() (events []*MetricsEvent)
type InfrastructureStage ¶
type InfrastructureStages ¶
type InfrastructureStages []InfrastructureStage
type InstanceState ¶
type InstanceState int
const ( Created InstanceState = iota Expressed Configured Kitted Distributed Activated Operating Disposed )
func (InstanceState) String ¶
func (instanceState InstanceState) String() string
type IperfSummary ¶
type IperfSummary struct { Timeslices []*IperfTimeslice `json:"timeslices"` Bytes float64 `json:"bytes"` BitsPerSecond float64 `json:"bits_per_second"` }
type IperfTimeslice ¶
type IperfUdpSummary ¶
type IperfUdpSummary struct { Timeslices []*IperfUdpTimeslice `json:"timeslices"` Bytes float64 `json:"bytes"` BitsPerSecond float64 `json:"bits_per_second"` JitterMs float64 `json:"jitter_ms"` LostPackets float64 `json:"lost_packets"` }
type IperfUdpTimeslice ¶
type Label ¶
type Label struct { Model string `yaml:"model"` State InstanceState `yaml:"state"` Bindings Bindings `yaml:"bindings"` // contains filtered or unexported fields }
func LoadLabelForInstance ¶
func (*Label) GetFilePath ¶
func (*Label) SaveAtPath ¶
type MemoryTimeslice ¶
type MemoryTimeslice struct { TimestampMs int64 `json:"timestamp_ms"` MemFreeK int64 `json:"free_k"` AvailK int64 `json:"avail_k"` UsedK int64 `json:"used_k"` UsedPercent float64 `json:"used_percent"` BuffersK int64 `json:"buffers_k"` CachedK int64 `json:"cached_k"` CommitK int64 `json:"commit_k"` CommitPercent float64 `json:"commit_percent"` ActiveK int64 `json:"active_k"` InactiveK int64 `json:"inactive_k"` DirtyK int64 `json:"dirty_k"` }
type MetricSet ¶
type MetricSet map[string]interface{}
func (MetricSet) AddGroupedMetric ¶
func (MetricSet) VisitGroupedMetrics ¶
func (MetricSet) VisitUngroupedMetrics ¶
type MetricsEvent ¶
type MetricsHandler ¶
type MetricsHandler interface {
AcceptHostMetrics(host *Host, event *MetricsEvent)
}
type Model ¶
type Model struct { Parent *Model Scope Regions Regions Factories []Factory BootstrapExtensions []BootstrapExtension Actions map[string]ActionBinder Infrastructure InfrastructureStages Configuration ConfigurationStages Distribution DistributionStages Activation ActivationStages Operation OperatingStages Disposal DisposalStages MetricsHandlers []MetricsHandler // contains filtered or unexported fields }
func (*Model) Accept ¶
func (m *Model) Accept(visitor EntityVisitor)
func (*Model) AcceptHostMetrics ¶
func (m *Model) AcceptHostMetrics(host *Host, event *MetricsEvent)
func (*Model) AddActivationActions ¶
func (*Model) AddActivationStage ¶
func (m *Model) AddActivationStage(stage ActivationStage)
func (*Model) AddActivationStages ¶
func (m *Model) AddActivationStages(stage ...ActivationStage)
func (*Model) AddOperatingActions ¶
func (*Model) AddOperatingStage ¶
func (m *Model) AddOperatingStage(stage OperatingStage)
func (*Model) AddOperatingStages ¶
func (m *Model) AddOperatingStages(stages ...OperatingStage)
func (*Model) BindBindings ¶
func (*Model) ForEachComponent ¶
func (*Model) ForEachHost ¶
func (*Model) GetChildren ¶
func (*Model) GetParentEntity ¶
func (*Model) GetRequiredStringVariable ¶
func (m *Model) GetRequiredStringVariable(holder errorz.ErrorHolder, name ...string) string
func (*Model) GetVariable ¶
func (*Model) IterateScopes ¶
func (*Model) MustSelectHost ¶
func (*Model) MustSelectHosts ¶
func (*Model) MustSelectRegion ¶
func (*Model) MustStringVariable ¶
func (*Model) MustVariable ¶
func (*Model) SelectComponents ¶
func (*Model) SelectHosts ¶
func (*Model) SelectRegions ¶
type OperatingStage ¶
type OperatingStages ¶
type OperatingStages []OperatingStage
type ProcessTimeslice ¶
type ProcessTimeslice struct { TimestampMs int64 `json:"timestamp_ms"` RunQueueSize int64 `json:"run_queue_size"` ProcessListSize int64 `json:"process_list_size"` LoadAverage1m float64 `json:"load_average_1m"` LoadAverage5m float64 `json:"load_average_5m` LoadAverage15m float64 `json:"load_average_15m"` Blocked int64 `json:"blocked"` }
type Region ¶
func (*Region) Accept ¶
func (region *Region) Accept(visitor EntityVisitor)
func (*Region) GetChildren ¶
func (*Region) GetParentEntity ¶
type RegionDump ¶
type Scope ¶
type StdOutMetricsWriter ¶
type StdOutMetricsWriter struct { }
func (StdOutMetricsWriter) AcceptHostMetrics ¶
func (StdOutMetricsWriter) AcceptHostMetrics(host *Host, event *MetricsEvent)
type VariableDump ¶
type VariableDump struct { Description string `json:"description,omitempty"` Default string `json:"default,omitempty"` Required bool `json:"required"` Scoped bool `json:"scoped"` GlobalFallback bool `json:"global_fallback"` Sensitive bool `json:"sensitive"` Binder string `json:"binder,omitempty"` Value string `json:"value,omitempty"` Bound bool `json:"bound"` }
type ZitiFabricLinkSummary ¶
type ZitiFabricMeshSummary ¶
type ZitiFabricMeshSummary struct { TimestampMs int64 `json:"timestamp_ms"` RouterIds []string `json:"router_ids"` Links []ZitiFabricLinkSummary `json:"links,omitempty"` }
type ZitiFabricRouterMetricsSummary ¶
type ZitiFabricRouterMetricsSummary struct { SourceId string `json:"source_id"` TimestampMs int64 `json:"timestamp_ms"` FabricRxBytesRateM1 float64 `json:"fabric_rx_bytes_rate_m1"` FabricTxBytesRateM1 float64 `json:"fabric_tx_bytes_rate_m1"` IngressRxBytesRateM1 float64 `json:"ingress_rx_bytes_rate_m1"` IngressTxBytesRateM1 float64 `json:"ingress_tx_bytes_rate_m1"` EgressRxBytesRateM1 float64 `json:"egress_rx_bytes_rate_m1"` EgressTxBytesRateM1 float64 `json:"egress_tx_bytes_rate_m1"` Links []ZitiFabricLinkMetricsSummary `json:"links,omitempty"` }
Click to show internal directories.
Click to hide internal directories.