closer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ExitCodeError int = 1
)

Variables

View Source
var Component = &app.Component{
	Constructor: app.Constructor(func(container container.Container) error {
		return container.Provides(
			NewOsSignal,
			func(closer *OsSignal) Closer { return closer },
		)
	}),
	Serve: app.ServeChan(func(container container.Container, isServeChan chan struct{}) error {
		return container.Invoke(func(closer *OsSignal) {
			isServeChan <- struct{}{}
			closer.Serve()
		})
	}),
}

Functions

This section is empty.

Types

type Closer

type Closer interface {
	io.Closer
	GetContext() context.Context
	Closed() bool
}

type OsSignal

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

func NewOsSignal

func NewOsSignal() *OsSignal

func (*OsSignal) Close

func (closer *OsSignal) Close() error

func (*OsSignal) Closed

func (closer *OsSignal) Closed() bool

func (*OsSignal) GetContext

func (closer *OsSignal) GetContext() context.Context

func (*OsSignal) Serve

func (closer *OsSignal) Serve()

Jump to

Keyboard shortcuts

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