Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExceptionFunc ¶
type ExceptionFunc func(data interface{}, errMsg error)
ExceptionFunc the exception callback
type Inputer ¶
type Inputer interface {
// Description the Inputer description.
// This information will be printed when the Inputer is abnormal, which is convenient for debugging.
Name() string
// Run execute the user logics
Run(ctx InputerContext) *InputerResult
// Stop stop the run function
Stop() error
}
Inputer is the interface that must be implemented by every Inputer.
type InputerParams ¶
type InputerParams struct {
IsTiming bool
Frequency time.Duration
Target Inputer
Kind InputerType
Putter output.Puter
}
InputerParams the inputer params
type InputerStatus ¶
type InputerStatus int
InputerStatus the inputer status type definition.
const ( // NormalStatus Inputer just created NormalStatus InputerStatus = iota // WaitingToRunStatus Inputer is waiting to run WaitingToRunStatus // RunningStatus Inputer is running RunningStatus // StoppingStatus Inputer normal exiting StoppingStatus // StoppedStatus Inputer normal exit StoppedStatus // ExceptionExitStatus Inputer abnormal exit ExceptionExitStatus )
Inputer status type
type InputerType ¶
type InputerType int
InputerType the inputer type definition
const ( // ExecuteOnce only execute onece, non-blocking ExecuteOnce InputerType = iota // ExecuteTiming timing execute ExecuteTiming // ExecuteLoop loop execution does not exit, blocking ExecuteLoop )
InputerType definition
type Manager ¶
type Manager interface {
// AddInputer add a new inputer
AddInputer(params InputerParams) InputerKey
// RemoveInputer remove the Inputer by a WorkerKey
RemoveInputer(key InputerKey)
// Run start the business cycle until the stop method is called.
Run(ctx context.Context, inputerCtx InputerContext)
// Stop
Stop() error
}
Manager is the interface that must be implemented by every input manager.
Click to show internal directories.
Click to hide internal directories.