grace

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetListenerFdFailed = errors.New("get listener fd failed")
)

Functions

This section is empty.

Types

type Hold

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

func NewHold

func NewHold(shutdown func(ctx context.Context) (err error)) *Hold

func (*Hold) Start

func (h *Hold) Start()

type Option

type Option struct {
	Addr   string `yaml:"addr" json:"addr"`
	Server Server
}

type Server

type Server interface {
	Serve(l net.Listener) error
	Shutdown(ctx context.Context) error
}

type TcpServer

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

func NewTcpServer

func NewTcpServer(option *Option) (server *TcpServer, err error)

func (*TcpServer) Serve

func (ts *TcpServer) Serve()

Jump to

Keyboard shortcuts

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