Documentation ¶
Index ¶
- func GetAllRegisteredJoints() map[string]interface{}
- func Register(jointName JointKey, joint Joint)
- func RegisterByName(jointName string, joint Joint)
- type Context
- type Joint
- type JointConfig
- type JointKey
- type ParaKey
- type Parameters
- func (this *Parameters) Get(key ParaKey) interface{}
- func (this *Parameters) GetInt(key ParaKey) (int, bool)
- func (this *Parameters) GetMap(key ParaKey) (map[string]interface{}, bool)
- func (this *Parameters) GetOrDefault(key ParaKey, val interface{}) interface{}
- func (this *Parameters) GetString(key ParaKey) (string, bool)
- func (this *Parameters) GetStringOrDefault(key ParaKey, val string) string
- func (this *Parameters) Has(key ParaKey) bool
- func (this *Parameters) Init()
- func (this *Parameters) MustGet(key ParaKey) interface{}
- func (this *Parameters) MustGetBytes(key ParaKey) []byte
- func (this *Parameters) MustGetInt(key ParaKey) int
- func (this *Parameters) MustGetMap(key ParaKey) map[string]interface{}
- func (this *Parameters) MustGetString(key ParaKey) string
- func (this *Parameters) Set(key ParaKey, value interface{})
- type Phrase
- type Pipeline
- func (this *Pipeline) Context(s *Context) *Pipeline
- func (this *Pipeline) End(s Joint) *Pipeline
- func (this *Pipeline) GetContext() *Context
- func (this *Pipeline) GetID() string
- func (this *Pipeline) Join(s Joint) *Pipeline
- func (this *Pipeline) Run() *Context
- func (this *Pipeline) Start(s Joint) *Pipeline
- type PipelineConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllRegisteredJoints ¶
func GetAllRegisteredJoints() map[string]interface{}
func RegisterByName ¶
Types ¶
type Context ¶
type Context struct { Simulate bool `json:"simulate"` Parameters Phrase Phrase `json:"phrase"` IgnoreBroken bool `json:"ignore_broken"` Payload interface{} `json:"-"` // contains filtered or unexported fields }
func (*Context) Break ¶
func (this *Context) Break(msg interface{})
* break all pipelines, but the end phrase not included
func (*Context) ErrorExit ¶
func (this *Context) ErrorExit(msg interface{})
* tell pipeline to exit all
func (*Context) IsErrorExit ¶
* break all pipelines, without execute the end phrase
type Joint ¶
func GetJointInstance ¶
func GetJointInstance(cfg *JointConfig) Joint
type JointConfig ¶
type JointConfig struct { JointName string `json:"joint_name"` //the joint name Parameters map[string]interface{} `json:"parameters"` //kv parameters for this joint }
* config for each joint
type Parameters ¶
type Parameters struct { Data map[string]interface{} `json:"data"` // contains filtered or unexported fields }
func (*Parameters) Get ¶
func (this *Parameters) Get(key ParaKey) interface{}
func (*Parameters) GetMap ¶
func (this *Parameters) GetMap(key ParaKey) (map[string]interface{}, bool)
func (*Parameters) GetOrDefault ¶
func (this *Parameters) GetOrDefault(key ParaKey, val interface{}) interface{}
func (*Parameters) GetStringOrDefault ¶
func (this *Parameters) GetStringOrDefault(key ParaKey, val string) string
func (*Parameters) Has ¶
func (this *Parameters) Has(key ParaKey) bool
func (*Parameters) Init ¶
func (this *Parameters) Init()
func (*Parameters) MustGet ¶
func (this *Parameters) MustGet(key ParaKey) interface{}
func (*Parameters) MustGetBytes ¶
func (this *Parameters) MustGetBytes(key ParaKey) []byte
func (*Parameters) MustGetInt ¶
func (this *Parameters) MustGetInt(key ParaKey) int
return 0 if not key was found
func (*Parameters) MustGetMap ¶
func (this *Parameters) MustGetMap(key ParaKey) map[string]interface{}
func (*Parameters) MustGetString ¶
func (this *Parameters) MustGetString(key ParaKey) string
func (*Parameters) Set ¶
func (this *Parameters) Set(key ParaKey, value interface{})
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
func NewPipeline ¶
func NewPipelineFromConfig ¶
func NewPipelineFromConfig(config *PipelineConfig) *Pipeline
func (*Pipeline) GetContext ¶
type PipelineConfig ¶
type PipelineConfig struct { Name string `json:"name"` Context *Context `json:"context"` InputJoint *JointConfig `json:"input_joint"` ProcessJoints []*JointConfig `json:"process_joints"` OutputJoint *JointConfig `json:"output_joint"` }
* config for each pipeline, a pipeline have more than one joints
Click to show internal directories.
Click to hide internal directories.