gs

package module
v0.0.0-...-39bc34b Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 6 Imported by: 0

README

log

Graceful shutdown

git

go get https://github.com/inkochetkov/gs

exmple

Documentation

Index

Constants

View Source
const (
	App   = "app: "
	Start = "start"
	Stop  = "stop"
)

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context) (context.Context, context.CancelFunc)

NewContext GracefulShutdown only

func NewModuleContext

func NewModuleContext(ctx context.Context) context.Context

NewModuleContext to module

Types

type Module

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

func New

func New(ctx context.Context, logger *log.Log) *Module

func (*Module) Add

func (s *Module) Add(fStart func(ctx context.Context) error, fStop func(ctx context.Context) error)

Add module

func (*Module) Start

func (s *Module) Start()

Start all module

Jump to

Keyboard shortcuts

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