Documentation
¶
Index ¶
- Variables
- func NewCommand(name string) *command
- func NewComponent(name string, t reflect.Type) *component
- type App
- type Builder
- type Component
- type Context
- func (c Context) Args() []string
- func (c Context) Flag(name string) any
- func (c Context) FlagBool(name string) bool
- func (c Context) FlagDuration(name string) time.Duration
- func (c Context) FlagFloat64(name string) float64
- func (c Context) FlagInt(name string) int
- func (c Context) FlagInt64(name string) int64
- func (c Context) FlagString(name string) string
- func (c Context) GetComponent(name string, t reflect.Type) (Component, error)
- func (c Context) SetComponent(component Component) error
- type Flag
- type FlagType
- type Signal
- type Signals
- func (s *Signals) CustomSignals() []os.Signal
- func (s *Signals) Handler(signal os.Signal) func(ctx Context, cancel context.CancelFunc, sig os.Signal) error
- func (s *Signals) ReloadFunc(ctx Context, cancel context.CancelFunc) error
- func (s *Signals) ReloadSignals() []os.Signal
- func (s *Signals) ShutdownFunc(ctx Context, cancel context.CancelFunc, chRun chan error) (err error)
- func (s *Signals) ShutdownSignals() []os.Signal
- func (s *Signals) WithCustomSignal(signal Signal) *Signals
- func (s *Signals) WithReloadOverride(signals []os.Signal, ...) *Signals
- func (s *Signals) WithShutdownOverride(signals []os.Signal, ...) *Signals
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultOsReloadSignals = []os.Signal{syscall.SIGHUP} DefaultOsShutdownSignals = []os.Signal{syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT} DefaultShutdownTimeout = time.Second * 2 DefaultSignals = &Signals{ shutdownSignals: DefaultOsShutdownSignals, shutdownFunc: nil, gracefulShutdown: true, gracefulShutdownTimeout: DefaultShutdownTimeout, reloadSignals: DefaultOsReloadSignals, customSignals: nil, mux: &sync.RWMutex{}, } ErrReload = errors.New("reload requested") )
Shutdown configuration
Functions ¶
func NewCommand ¶
func NewCommand(name string) *command
func NewComponent ¶
Types ¶
type Builder ¶
type Context ¶
func (Context) FlagFloat64 ¶
func (Context) FlagString ¶
func (Context) GetComponent ¶
func (Context) SetComponent ¶
type Signals ¶
type Signals struct {
// contains filtered or unexported fields
}
func NewSignals ¶
func NewSignals() *Signals
func (*Signals) CustomSignals ¶
func (*Signals) ReloadFunc ¶
func (s *Signals) ReloadFunc(ctx Context, cancel context.CancelFunc) error
func (*Signals) ReloadSignals ¶
func (*Signals) ShutdownFunc ¶
func (*Signals) ShutdownSignals ¶
func (*Signals) WithCustomSignal ¶
func (*Signals) WithReloadOverride ¶
Click to show internal directories.
Click to hide internal directories.