Documentation
¶
Index ¶
- Constants
- func IsFatal(err error) bool
- func NoRestartErr(err error) error
- func SpecWithDebugLogger() suture.Spec
- func SpecWithInfoLogger() suture.Spec
- type ExitStatus
- type FatalErr
- type Manager
- func (m *Manager) Add(srv Service) error
- func (m *Manager) Delete(name string) error
- func (m *Manager) Has(name string) bool
- func (m *Manager) OnClose(fn func())
- func (m *Manager) RemoveServices() (gErr error)
- func (m *Manager) RestartService(name string) (gErr error)
- func (m *Manager) RestartServices() (gErr error)
- func (m *Manager) Run(ctx context.Context) error
- func (m *Manager) Serve(ctx context.Context) error
- func (m *Manager) ServeBackground(ctx context.Context) <-chan error
- func (m *Manager) Services() []Service
- type Metric
- type Service
- type Supervisor
Constants ¶
View Source
const ServiceTimeout = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
func NoRestartErr ¶
NoRestartErr wraps the given error err (which may be nil) to make sure that `errors.Is(err, suture.ErrDoNotRestart) == true`.
func SpecWithDebugLogger ¶
func SpecWithDebugLogger() suture.Spec
func SpecWithInfoLogger ¶
func SpecWithInfoLogger() suture.Spec
Types ¶
type ExitStatus ¶
type ExitStatus int
const ( ExitSuccess ExitStatus = 0 ExitError ExitStatus = 1 ExitNoUpgradeAvailable ExitStatus = 2 ExitRestart ExitStatus = 3 ExitUpgrade ExitStatus = 4 )
func (ExitStatus) AsInt ¶
func (s ExitStatus) AsInt() int
type FatalErr ¶
type FatalErr struct {
Err error
Status ExitStatus
}
func AsFatalErr ¶
func AsFatalErr(err error, status ExitStatus) (gErr *FatalErr)
AsFatalErr wraps the given error creating a FatalErr. If the given error already is of type FatalErr, it is not wrapped again.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) RemoveServices ¶
func (*Manager) RestartService ¶
func (*Manager) RestartServices ¶
func (*Manager) ServeBackground ¶
type Service ¶
type Supervisor ¶
type Supervisor = suture.Supervisor
Click to show internal directories.
Click to hide internal directories.