graceful

package
v0.0.0-...-f48be0a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 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