wmap

package
Version: v0.16.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 16, 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"`
	Tags         map[string]map[string]string      `json:"tags,omitempty"yaml:"tags"`
	ProcessNodes []ProcessWorkflowMapNode          `json:"process,omitempty"yaml:"process"`
	PublishNodes []PublishWorkflowMapNode          `json:"publish,omitempty"yaml:"publish"`
}

func NewCollectWorkflowMapNode

func NewCollectWorkflowMapNode() *CollectWorkflowMapNode

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) GetTags

func (c *CollectWorkflowMapNode) GetTags() map[string]map[string]string

func (*CollectWorkflowMapNode) String

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

func (*CollectWorkflowMapNode) UnmarshalJSON

func (cw *CollectWorkflowMapNode) UnmarshalJSON(data []byte) error

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"`
	Target string                 `json:"target"yaml:"target"`
}

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

func (*ProcessWorkflowMapNode) UnmarshalJSON

func (pw *ProcessWorkflowMapNode) UnmarshalJSON(data []byte) error

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"`
	Target string                 `json:"target"yaml:"target"`
}

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

func (*PublishWorkflowMapNode) UnmarshalJSON

func (pw *PublishWorkflowMapNode) UnmarshalJSON(data []byte) error

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)

func (*WorkflowMap) UnmarshalJSON

func (w *WorkflowMap) UnmarshalJSON(data []byte) error

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL