Documentation ¶
Index ¶
- Variables
- func AddControlHooksToContext(ctx context.Context, statusHooks ControlHooks) context.Context
- func OnControlEvent(ctx context.Context, p *ControlProgress)
- func OnDone(ctx context.Context, p *ControlProgress)
- func OnStart(ctx context.Context, p *ControlProgress)
- type ControlHooks
- type ControlProgress
- func (p *ControlProgress) Finish(ctx context.Context)
- func (p *ControlProgress) OnControlComplete(ctx context.Context)
- func (p *ControlProgress) OnControlError(ctx context.Context)
- func (p *ControlProgress) OnControlFinish(ctx context.Context)
- func (p *ControlProgress) OnControlStart(ctx context.Context, control *modconfig.Control)
- func (p *ControlProgress) Start(ctx context.Context)
- type ControlStatusHooks
- type NullControlHook
Constants ¶
This section is empty.
Variables ¶
View Source
var NullHooks = &NullControlHook{}
Functions ¶
func AddControlHooksToContext ¶
func AddControlHooksToContext(ctx context.Context, statusHooks ControlHooks) context.Context
func OnControlEvent ¶
func OnControlEvent(ctx context.Context, p *ControlProgress)
func OnDone ¶
func OnDone(ctx context.Context, p *ControlProgress)
func OnStart ¶
func OnStart(ctx context.Context, p *ControlProgress)
Types ¶
type ControlHooks ¶
type ControlHooks interface { OnStart(context.Context, *ControlProgress) OnControlEvent(context.Context, *ControlProgress) OnDone(context.Context, *ControlProgress) }
func ControlHooksFromContext ¶
func ControlHooksFromContext(ctx context.Context) ControlHooks
type ControlProgress ¶
type ControlProgress struct { Total int `json:"total"` Pending int `json:"pending"` Complete int `json:"complete"` Error int `json:"error"` Executing int `json:"executing"` // contains filtered or unexported fields }
func NewControlProgress ¶
func NewControlProgress(total int) *ControlProgress
func (*ControlProgress) Finish ¶
func (p *ControlProgress) Finish(ctx context.Context)
func (*ControlProgress) OnControlComplete ¶
func (p *ControlProgress) OnControlComplete(ctx context.Context)
func (*ControlProgress) OnControlError ¶
func (p *ControlProgress) OnControlError(ctx context.Context)
func (*ControlProgress) OnControlFinish ¶
func (p *ControlProgress) OnControlFinish(ctx context.Context)
func (*ControlProgress) OnControlStart ¶
func (p *ControlProgress) OnControlStart(ctx context.Context, control *modconfig.Control)
func (*ControlProgress) Start ¶
func (p *ControlProgress) Start(ctx context.Context)
type ControlStatusHooks ¶
type ControlStatusHooks struct {
Enabled bool
}
ControlStatusHooks is a struct which implements ControlHooks, and displays the control progress as a status message
func NewControlStatusHooks ¶
func NewControlStatusHooks() *ControlStatusHooks
func (*ControlStatusHooks) OnControlEvent ¶
func (c *ControlStatusHooks) OnControlEvent(ctx context.Context, p *ControlProgress)
func (*ControlStatusHooks) OnDone ¶
func (c *ControlStatusHooks) OnDone(ctx context.Context, _ *ControlProgress)
func (*ControlStatusHooks) OnStart ¶
func (c *ControlStatusHooks) OnStart(ctx context.Context, _ *ControlProgress)
type NullControlHook ¶
type NullControlHook struct{}
func (*NullControlHook) OnControlEvent ¶
func (*NullControlHook) OnControlEvent(context.Context, *ControlProgress)
func (*NullControlHook) OnDone ¶
func (*NullControlHook) OnDone(context.Context, *ControlProgress)
func (*NullControlHook) OnStart ¶
func (*NullControlHook) OnStart(context.Context, *ControlProgress)
Click to show internal directories.
Click to hide internal directories.