shutter

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shut

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

func NewShutter

func NewShutter(log *slog.Logger) *Shut

NewShutter creates a new shutter instance. If the log is nil, then discard logger will be used.

func (*Shut) Down

func (s *Shut) Down()

Down walks a shutdown list in reverse and call Close() one by one

func (*Shut) Up

func (s *Shut) Up(to ...Shutter)

Up add thing that requires shutdown

func (*Shut) UpFunc

func (s *Shut) UpFunc(f ...func())

UpFunc add blank shutdown function

type Shutter

type Shutter interface {
	Close() error
}

Shutter is an interface for something that can be shutdown. Same as io.Closer interface.

Jump to

Keyboard shortcuts

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