Documentation ¶
Index ¶
- type PipeLevel
- type PipeLine
- type SimpleFunc
- type SimpleFuncStage
- func (s *SimpleFuncStage) AddStage(parent string, name string, stage PipeLine) PipeLine
- func (s *SimpleFuncStage) CustomizeStage(name string, stage PipeLine) PipeLine
- func (s *SimpleFuncStage) Exec(input interface{}) (output interface{}, err error)
- func (s *SimpleFuncStage) GetStage(name string) PipeLine
- func (s *SimpleFuncStage) Len() int
- func (s *SimpleFuncStage) Less(i, j int) bool
- func (s *SimpleFuncStage) Pop() interface{}
- func (s *SimpleFuncStage) Push(x interface{})
- func (s *SimpleFuncStage) RemoveStage(name string) PipeLine
- func (s *SimpleFuncStage) SetDefaultPPL(p PipeLevel) *SimpleFuncStage
- func (s *SimpleFuncStage) SetFunc(f SimpleFunc) *SimpleFuncStage
- func (s *SimpleFuncStage) SetPriority(p PipeLevel) *SimpleFuncStage
- func (s *SimpleFuncStage) String() string
- func (s *SimpleFuncStage) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipeLevel ¶
type PipeLevel int8
PipeLevel level in pipe
const ( Debugger PipeLevel = iota // default 0:debug wrap Enhancer // enhancer feature Feature // user feature Initiator PipeLevel = math.MinInt8 // run first,default priority Runner PipeLevel = math.MaxInt8 // final runner )
priority const lower will run before than higher you can customize your own priority
func ClosePipeLevel ¶
ClosePipeLevel by original pipeLevel if register close, flip around 0 would be useful
type PipeLine ¶
type PipeLine interface { heap.Interface // sort by pipeLevel fmt.Stringer // print order by pipeLevel AddStage(parent string, name string, stage PipeLine) PipeLine GetStage(name string) PipeLine CustomizeStage(name string, stage PipeLine) PipeLine RemoveStage(name string) PipeLine Exec(input interface{}) (output interface{}, err error) }
PipeLine interface every stage is also a pipeline
type SimpleFuncStage ¶
type SimpleFuncStage struct {
// contains filtered or unexported fields
}
SimpleFuncStage simple func stage
func NewSimpleFuncStage ¶
func NewSimpleFuncStage(name, split string) *SimpleFuncStage
NewSimpleFuncStage empty root simple func pipe
func (*SimpleFuncStage) AddStage ¶
func (s *SimpleFuncStage) AddStage(parent string, name string, stage PipeLine) PipeLine
AddStage add stage to pipe or offspring of this pipe
func (*SimpleFuncStage) CustomizeStage ¶
func (s *SimpleFuncStage) CustomizeStage(name string, stage PipeLine) PipeLine
CustomizeStage customize stage with new stage
func (*SimpleFuncStage) Exec ¶
func (s *SimpleFuncStage) Exec(input interface{}) (output interface{}, err error)
Exec finally
func (*SimpleFuncStage) GetStage ¶
func (s *SimpleFuncStage) GetStage(name string) PipeLine
GetStage get stage with name
func (*SimpleFuncStage) Len ¶
func (s *SimpleFuncStage) Len() int
func (*SimpleFuncStage) Less ¶
func (s *SimpleFuncStage) Less(i, j int) bool
func (*SimpleFuncStage) Pop ¶
func (s *SimpleFuncStage) Pop() interface{}
func (*SimpleFuncStage) Push ¶
func (s *SimpleFuncStage) Push(x interface{})
func (*SimpleFuncStage) RemoveStage ¶
func (s *SimpleFuncStage) RemoveStage(name string) PipeLine
RemoveStage remove stage with name
func (*SimpleFuncStage) SetDefaultPPL ¶
func (s *SimpleFuncStage) SetDefaultPPL(p PipeLevel) *SimpleFuncStage
SetDefaultPPL set default priority for parent(auto added)
func (*SimpleFuncStage) SetFunc ¶
func (s *SimpleFuncStage) SetFunc(f SimpleFunc) *SimpleFuncStage
SetFunc set func
func (*SimpleFuncStage) SetPriority ¶
func (s *SimpleFuncStage) SetPriority(p PipeLevel) *SimpleFuncStage
SetPriority set priority
func (*SimpleFuncStage) String ¶
func (s *SimpleFuncStage) String() string
String help debug print exec pipeline
func (*SimpleFuncStage) Swap ¶
func (s *SimpleFuncStage) Swap(i, j int)