graceful

package
v0.0.0-...-3273997 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 12 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL