Documentation ¶
Index ¶
- Variables
- func ArgumentsFrom(ctx context.Context) ([]interface{}, bool)
- func Child(ctx context.Context, exec Executor) chan error
- func FromCrontab(ctx context.Context) time.Time
- func FromRepeat(ctx context.Context) int
- func FromRetry(ctx context.Context) int
- func Main(ctx context.Context, exec Executor, opts ...Opt) error
- func WithArgments(ctx context.Context, args ...interface{}) context.Context
- func WithParent(ctx context.Context, parent *Routine) context.Context
- type AppendExecutor
- type CommandExecutor
- type CommandOpt
- type ConcurrentExecutor
- type CrontabExecutor
- func (c *CrontabExecutor) Everyday(flag bool)
- func (c *CrontabExecutor) Execute(ctx context.Context) error
- func (c *CrontabExecutor) IsTimeMuted(tm time.Time) bool
- func (c *CrontabExecutor) Mute(begin time.Time, end time.Time)
- func (c *CrontabExecutor) Weekend(flag bool)
- func (c *CrontabExecutor) Workday(flag bool)
- type CrontabMute
- type DeadlineExecutor
- type Executor
- type ExecutorFunc
- type ExecutorMiddleware
- type GuaranteeExecutor
- type Opt
- type ParallelExecutor
- type ProfilingExecutor
- type RepeatExecutor
- type RetryExecutor
- type Routine
- type SigHandler
- type SigTrap
- type TimeoutExecutor
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ArgumentsFrom ¶ added in v1.1.0
ArgumentsFrom extract from context
func WithArgments ¶
WithArgments inject into context
Types ¶
type AppendExecutor ¶ added in v1.2.6
type AppendExecutor struct {
// contains filtered or unexported fields
}
AppendExecutor
func (*AppendExecutor) Append ¶ added in v1.2.6
func (ae *AppendExecutor) Append(execs ...Executor)
type CommandExecutor ¶
type CommandExecutor struct {
// contains filtered or unexported fields
}
CommandExecutor struct
type CommandOpt ¶ added in v1.2.5
type CommandOpt func(*CommandExecutor)
func ARG ¶ added in v1.2.5
func ARG(arg string) CommandOpt
func ENV ¶ added in v1.2.5
func ENV(env string) CommandOpt
func Stderr ¶ added in v1.2.5
func Stderr(wr io.Writer) CommandOpt
func Stdin ¶ added in v1.2.5
func Stdin(rd io.Reader) CommandOpt
func Stdout ¶ added in v1.2.5
func Stdout(wr io.Writer) CommandOpt
type ConcurrentExecutor ¶
type ConcurrentExecutor struct {
// contains filtered or unexported fields
}
ConcurrentExecutor struct
type CrontabExecutor ¶
type CrontabExecutor struct {
// contains filtered or unexported fields
}
CrontabExecutor struct
func (*CrontabExecutor) Everyday ¶ added in v1.2.2
func (c *CrontabExecutor) Everyday(flag bool)
func (*CrontabExecutor) Execute ¶
func (c *CrontabExecutor) Execute(ctx context.Context) error
Execute implement Executor
func (*CrontabExecutor) IsTimeMuted ¶ added in v1.2.2
func (c *CrontabExecutor) IsTimeMuted(tm time.Time) bool
func (*CrontabExecutor) Mute ¶ added in v1.2.2
func (c *CrontabExecutor) Mute(begin time.Time, end time.Time)
func (*CrontabExecutor) Weekend ¶ added in v1.2.2
func (c *CrontabExecutor) Weekend(flag bool)
func (*CrontabExecutor) Workday ¶ added in v1.2.2
func (c *CrontabExecutor) Workday(flag bool)
type CrontabMute ¶ added in v1.2.2
type CrontabMute struct {
// contains filtered or unexported fields
}
type DeadlineExecutor ¶
type DeadlineExecutor struct {
// contains filtered or unexported fields
}
DeadlineExecutor struct
type Executor ¶
type Executor interface { //Execute before stopping make sure all subroutines stopped Execute(context.Context) error }
Executor interface definition
func UseExecutorMiddleware ¶
func UseExecutorMiddleware(exec Executor, middleware ...ExecutorMiddleware) Executor
UseExecutorMiddleware wraps a Executor in one or more middleware.
type ExecutorFunc ¶
ExecutorFunc definition
type ExecutorMiddleware ¶
ExecutorMiddleware is a function that middlewares can implement to be able to chain.
type GuaranteeExecutor ¶
type GuaranteeExecutor struct {
// contains filtered or unexported fields
}
GuaranteeExecutor struct, make sure of none error return
type Opt ¶
type Opt func(*options)
Opt interface
func CancelSignals ¶ added in v1.3.0
CancelSignals Opt for Main
type ParallelExecutor ¶ added in v1.2.1
type ParallelExecutor struct {
// contains filtered or unexported fields
}
ParallelExecutor
type ProfilingExecutor ¶ added in v1.2.10
type ProfilingExecutor struct {
// contains filtered or unexported fields
}
Profiling
func Profiling ¶ added in v1.2.10
func Profiling(addr string) *ProfilingExecutor
type RepeatExecutor ¶
type RepeatExecutor struct {
// contains filtered or unexported fields
}
RepeatExecutor struct
type RetryExecutor ¶
type RetryExecutor struct {
// contains filtered or unexported fields
}
RetryExecutor struct
type Routine ¶
type Routine struct {
// contains filtered or unexported fields
}
Routine Definition
func (*Routine) Close ¶ added in v1.3.2
func (r *Routine) Close() <-chan struct{}
Stop trigger the routine to stop
type SigHandler ¶ added in v1.3.0
type SigHandler func()
type TimeoutExecutor ¶
type TimeoutExecutor struct {
// contains filtered or unexported fields
}
TimeoutExecutor struct
Click to show internal directories.
Click to hide internal directories.