Documentation ¶
Index ¶
- type ExecutionPlan
- func (p *ExecutionPlan) Add(name string, handler ExitOperation) *ExecutionPlan
- func (p *ExecutionPlan) AddMany(many map[string]ExitOperation) *ExecutionPlan
- func (p *ExecutionPlan) Finally(handler ExitOperation) *ExecutionPlan
- func (p *ExecutionPlan) HandlerFunc(w http.ResponseWriter, r *http.Request)
- func (p *ExecutionPlan) IsTerminating() bool
- func (p *ExecutionPlan) Wait()
- func (p *ExecutionPlan) WaitContext(ctx context.Context)
- func (p *ExecutionPlan) WaitWithChan(ctx context.Context) <-chan struct{}
- type ExitOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionPlan ¶
type ExecutionPlan struct { Signals []os.Signal Timeout time.Duration GradePeriod time.Duration // contains filtered or unexported fields }
func NewPlan ¶
func NewPlan() *ExecutionPlan
NewPlan will create a new ExecutionPlan with a default
GradePeriod of 5 seconds and Timeout of 25 seconds
func NewPlanWithTimer ¶
func NewPlanWithTimer(gradePeriod, timeout time.Duration) *ExecutionPlan
func (*ExecutionPlan) Add ¶
func (p *ExecutionPlan) Add(name string, handler ExitOperation) *ExecutionPlan
func (*ExecutionPlan) AddMany ¶
func (p *ExecutionPlan) AddMany(many map[string]ExitOperation) *ExecutionPlan
func (*ExecutionPlan) Finally ¶
func (p *ExecutionPlan) Finally(handler ExitOperation) *ExecutionPlan
func (*ExecutionPlan) HandlerFunc ¶
func (p *ExecutionPlan) HandlerFunc(w http.ResponseWriter, r *http.Request)
HandlerFunc is used on the HTTP Server Side to support a RESTful way of ready state. See https://kubernetes.io/docs/reference/using-api/health-checks/ for more information
func (*ExecutionPlan) IsTerminating ¶
func (p *ExecutionPlan) IsTerminating() bool
func (*ExecutionPlan) Wait ¶
func (p *ExecutionPlan) Wait()
func (*ExecutionPlan) WaitContext ¶
func (p *ExecutionPlan) WaitContext(ctx context.Context)
WaitContext will wait until the program gets an exit signal and all handlers have succeeded. If used on the main thread, this will allow it to die
func (*ExecutionPlan) WaitWithChan ¶
func (p *ExecutionPlan) WaitWithChan(ctx context.Context) <-chan struct{}
type ExitOperation ¶
ExitOperation is a clean up function on shutting down
Click to show internal directories.
Click to hide internal directories.