graceful

package module
v0.0.0-...-f954b90 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, r Runner) error

func Shutdown

func Shutdown(ctx context.Context, s Stoppable) error

Types

type Container

type Container struct {
	// contains filtered or unexported fields
}

func (*Container) Add

func (c *Container) Add(name string, fn Func)

func (*Container) Shutdown

func (c *Container) Shutdown(ctx context.Context) (err error)

type Func

type Func func(ctx context.Context) error

type Runner

type Runner interface {
	Run(ctx context.Context) error
}

type ShutdownError

type ShutdownError struct {
	Messages []string
}

func (ShutdownError) Error

func (e ShutdownError) Error() string

type Stoppable

type Stoppable interface {
	Container() *Container
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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