Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface {
// WaitExitSignal is a method that waits for the application to exit
WaitExitSignal()
}
Application is an interface that represents an application
type Graceful ¶
type Graceful struct { // MainCtx is a context that will be used to control the application lifecycle MainCtx context.Context // Logger is a logger that will be used to log application events Logger *logger.Logger // StartAction is a function that will be called when the application starts StartAction func(ctx context.Context) error // ShutdownAction is a function that will be called when the application stops ShutdownAction func(ctx context.Context) error }
Graceful is a struct that represents an application with graceful shutdown
func (*Graceful) WaitExitSignal ¶
func (g *Graceful) WaitExitSignal()
type ShutdownCloser ¶
type ShutdownCloser struct {
// contains filtered or unexported fields
}
func NewShutdownCloser ¶
func NewShutdownCloser() *ShutdownCloser
func (*ShutdownCloser) Close ¶
func (c *ShutdownCloser) Close() error
func (*ShutdownCloser) Register ¶
func (c *ShutdownCloser) Register(closer io.Closer)
Click to show internal directories.
Click to hide internal directories.