graceful

package
v0.0.0-...-1ba6274 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDuration = errors.New("invalid duration")
	ErrExistingAddress = errors.New("the address has already been set")
	ErrInvalidAddr     = errors.New("invalid address")
	ErrMissingServices = errors.New("missing services")
)

Functions

func Multiple

func Multiple(services []Service, opts ...Option) (chan os.Signal, error)

Multiple allows for multiple services to operate.

func Single

func Single(service Service, opts ...Option) (chan os.Signal, error)

Single allows for a single Service to operate.

Types

type Log

type Log interface {
	LogAttrs(ctx context.Context, level slog.Level, msg string, attrs ...slog.Attr)
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func Logger

func Logger(logger Log) Option

func Timeout

func Timeout(duration time.Duration) Option

type Service

type Service struct {
	Start func() error
	Close func(context.Context) error
}

Jump to

Keyboard shortcuts

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