Documentation
¶
Index ¶
- func GetAllRegisteredJoints() map[string]interface{}
- func Register(joint Joint)
- func RegisterByName(jointName string, joint Joint)
- type Context
- type Joint
- type JointConfig
- type ParaKey
- type Parameters
- func (para *Parameters) Get(key ParaKey) interface{}
- func (para *Parameters) GetBool(key ParaKey, defaultV bool) bool
- func (para *Parameters) GetInt(key ParaKey, defaultV int) (int, bool)
- func (para *Parameters) GetInt64(key ParaKey, defaultV int64) (int64, bool)
- func (para *Parameters) GetInt64OrDefault(key ParaKey, defaultV int64) int64
- func (para *Parameters) GetIntOrDefault(key ParaKey, defaultV int) int
- func (para *Parameters) GetMap(key ParaKey) (map[string]interface{}, bool)
- func (para *Parameters) GetOrDefault(key ParaKey, val interface{}) interface{}
- func (para *Parameters) GetString(key ParaKey) (string, bool)
- func (para *Parameters) GetStringArray(key ParaKey) ([]string, bool)
- func (para *Parameters) GetStringOrDefault(key ParaKey, val string) string
- func (para *Parameters) Has(key ParaKey) bool
- func (para *Parameters) Init()
- func (para *Parameters) MustGet(key ParaKey) interface{}
- func (para *Parameters) MustGetBytes(key ParaKey) []byte
- func (para *Parameters) MustGetInt(key ParaKey) int
- func (para *Parameters) MustGetInt64(key ParaKey) int64
- func (para *Parameters) MustGetMap(key ParaKey) map[string]interface{}
- func (para *Parameters) MustGetString(key ParaKey) string
- func (para *Parameters) Set(key ParaKey, value interface{})
- type Phrase
- type Pipeline
- func (pipe *Pipeline) Context(s *Context) *Pipeline
- func (pipe *Pipeline) End(s Joint) *Pipeline
- func (pipe *Pipeline) GetContext() *Context
- func (pipe *Pipeline) GetID() string
- func (pipe *Pipeline) Join(s Joint) *Pipeline
- func (pipe *Pipeline) Run() *Context
- func (pipe *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 {
Parameters
Simulate bool `json:"simulate"`
Phrase Phrase `json:"phrase"`
IgnoreBroken bool `json:"ignore_broken"`
Payload interface{} `json:"-"`
// contains filtered or unexported fields
}
func (*Context) End ¶ added in v0.9.0
func (context *Context) End(msg interface{})
End break all pipelines, but the end phrase not included
func (*Context) Exit ¶ added in v0.9.0
func (context *Context) Exit(msg interface{})
Exit tells pipeline to exit
type Joint ¶
func GetJointInstance ¶
func GetJointInstance(cfg *JointConfig) Joint
type JointConfig ¶
type JointConfig struct {
JointName string `json:"joint" config:"joint"` //the joint name
Parameters map[string]interface{} `json:"parameters" config:"parameters"` //kv parameters for this joint
Enabled bool `json:"enabled" config:"enabled"`
}
JointConfig configs for each joint
type Parameters ¶
type Parameters struct {
Data map[string]interface{} `json:"data"`
// contains filtered or unexported fields
}
func (*Parameters) Get ¶
func (para *Parameters) Get(key ParaKey) interface{}
func (*Parameters) GetBool ¶ added in v0.9.0
func (para *Parameters) GetBool(key ParaKey, defaultV bool) bool
func (*Parameters) GetInt64 ¶ added in v0.9.0
func (para *Parameters) GetInt64(key ParaKey, defaultV int64) (int64, bool)
func (*Parameters) GetInt64OrDefault ¶ added in v0.9.0
func (para *Parameters) GetInt64OrDefault(key ParaKey, defaultV int64) int64
func (*Parameters) GetIntOrDefault ¶ added in v0.9.0
func (para *Parameters) GetIntOrDefault(key ParaKey, defaultV int) int
func (*Parameters) GetMap ¶
func (para *Parameters) GetMap(key ParaKey) (map[string]interface{}, bool)
func (*Parameters) GetOrDefault ¶
func (para *Parameters) GetOrDefault(key ParaKey, val interface{}) interface{}
func (*Parameters) GetStringArray ¶ added in v0.9.0
func (para *Parameters) GetStringArray(key ParaKey) ([]string, bool)
GetStringArray will return a array which type of the items are string
func (*Parameters) GetStringOrDefault ¶
func (para *Parameters) GetStringOrDefault(key ParaKey, val string) string
func (*Parameters) Has ¶
func (para *Parameters) Has(key ParaKey) bool
func (*Parameters) Init ¶
func (para *Parameters) Init()
func (*Parameters) MustGet ¶
func (para *Parameters) MustGet(key ParaKey) interface{}
func (*Parameters) MustGetBytes ¶
func (para *Parameters) MustGetBytes(key ParaKey) []byte
func (*Parameters) MustGetInt ¶
func (para *Parameters) MustGetInt(key ParaKey) int
MustGetInt return 0 if not key was found
func (*Parameters) MustGetInt64 ¶ added in v0.9.0
func (para *Parameters) MustGetInt64(key ParaKey) int64
func (*Parameters) MustGetMap ¶
func (para *Parameters) MustGetMap(key ParaKey) map[string]interface{}
func (*Parameters) MustGetString ¶
func (para *Parameters) MustGetString(key ParaKey) string
func (*Parameters) Set ¶
func (para *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" config:"name"`
Context *Context `json:"context" config:"context"`
StartJoint *JointConfig `json:"start" config:"start"`
ProcessJoints []*JointConfig `json:"process" config:"process"`
EndJoint *JointConfig `json:"end" config:"end"`
}
PipelineConfig config for each pipeline, a pipeline may have more than one joints
Click to show internal directories.
Click to hide internal directories.