wmap

package
v0.11.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidPayload = errors.New("Payload to convert must be string or []byte")
)

Functions

func SampleWorkflowMapJson

func SampleWorkflowMapJson() string

func SampleWorkflowMapYaml

func SampleWorkflowMapYaml() string

Types

type CollectWorkflowMapNode

type CollectWorkflowMapNode struct {
	Metrics      map[string]metricInfo             `json:"metrics"yaml:"metrics"`
	Config       map[string]map[string]interface{} `json:"config,omitempty"yaml:"config"`
	ProcessNodes []ProcessWorkflowMapNode          `json:"process,omitempty"yaml:"process"`
	PublishNodes []PublishWorkflowMapNode          `json:"publish,omitempty"yaml:"publish"`
}

func (*CollectWorkflowMapNode) Add

func (c *CollectWorkflowMapNode) Add(node interface{}) error

func (*CollectWorkflowMapNode) AddConfigItem

func (c *CollectWorkflowMapNode) AddConfigItem(ns, key string, value interface{})

func (*CollectWorkflowMapNode) AddMetric

func (c *CollectWorkflowMapNode) AddMetric(ns string, v int) error

func (*CollectWorkflowMapNode) GetConfigTree

func (c *CollectWorkflowMapNode) GetConfigTree() (*cdata.ConfigDataTree, error)

GetConfigTree converts config data for collection node in wmap into a proper cdata.ConfigDataTree

func (*CollectWorkflowMapNode) GetMetrics

func (c *CollectWorkflowMapNode) GetMetrics() []Metric

func (*CollectWorkflowMapNode) String

func (c *CollectWorkflowMapNode) String(pad string) string

type Metric

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

func (Metric) Namespace

func (m Metric) Namespace() []string

func (Metric) Version

func (m Metric) Version() int

type ProcessWorkflowMapNode

type ProcessWorkflowMapNode struct {
	Name         string                   `json:"plugin_name"yaml:"plugin_name"`
	Version      int                      `json:"plugin_version"yaml:"plugin_version"`
	ProcessNodes []ProcessWorkflowMapNode `json:"process,omitempty"yaml:"process"`
	PublishNodes []PublishWorkflowMapNode `json:"publish,omitempty"yaml:"publish"`
	// TODO processor config
	Config map[string]interface{} `json:"config,omitempty"yaml:"config"`
}

func NewProcessNode

func NewProcessNode(name string, version int) *ProcessWorkflowMapNode

func (*ProcessWorkflowMapNode) Add

func (p *ProcessWorkflowMapNode) Add(node interface{}) error

func (*ProcessWorkflowMapNode) AddConfigItem

func (p *ProcessWorkflowMapNode) AddConfigItem(key string, value interface{})

func (*ProcessWorkflowMapNode) GetConfigNode

func (p *ProcessWorkflowMapNode) GetConfigNode() (*cdata.ConfigDataNode, error)

func (*ProcessWorkflowMapNode) String

func (p *ProcessWorkflowMapNode) String(pad string) string

type PublishWorkflowMapNode

type PublishWorkflowMapNode struct {
	Name    string `json:"plugin_name"yaml:"plugin_name"`
	Version int    `json:"plugin_version"yaml:"plugin_version"`
	// TODO publisher config
	Config map[string]interface{} `json:"config,omitempty"yaml:"config"`
}

func NewPublishNode

func NewPublishNode(name string, version int) *PublishWorkflowMapNode

func (*PublishWorkflowMapNode) AddConfigItem

func (p *PublishWorkflowMapNode) AddConfigItem(key string, value interface{})

func (*PublishWorkflowMapNode) GetConfigNode

func (p *PublishWorkflowMapNode) GetConfigNode() (*cdata.ConfigDataNode, error)

func (*PublishWorkflowMapNode) String

func (p *PublishWorkflowMapNode) String(pad string) string

type WorkflowMap

type WorkflowMap struct {
	CollectNode *CollectWorkflowMapNode `json:"collect"yaml:"collect"`
}

A map of a desired workflow that is used to create a scheduleWorkflow

func FromJson

func FromJson(payload interface{}) (*WorkflowMap, error)

func FromYaml

func FromYaml(payload interface{}) (*WorkflowMap, error)

func NewWorkflowMap

func NewWorkflowMap() *WorkflowMap

func Sample

func Sample() *WorkflowMap

func (*WorkflowMap) String

func (w *WorkflowMap) String() string

func (*WorkflowMap) ToJson

func (w *WorkflowMap) ToJson() ([]byte, error)

func (*WorkflowMap) ToYaml

func (w *WorkflowMap) ToYaml() ([]byte, error)

Jump to

Keyboard shortcuts

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