app

package
v0.0.0-...-82265e9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(servers []*Server, opts ...Option) *App

func (*App) StartAndServe

func (a *App) StartAndServe()

type Option

type Option func(app *App)

func WithCallbackTimeout

func WithCallbackTimeout(t time.Duration) Option

func WithShutDownTimeout

func WithShutDownTimeout(t time.Duration) Option

func WithShutdownCallbacks

func WithShutdownCallbacks(cbs ...ShutdownCallback) Option

func WithWaitTime

func WithWaitTime(t time.Duration) Option

type Server

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

func NewServer

func NewServer(name, add string) *Server

func (*Server) Handle

func (s *Server) Handle(patten string, handler http.Handler)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

type ShutdownCallback

type ShutdownCallback func(ctx context.Context)

type SigHandler

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

func NewSigHandler

func NewSigHandler(timeout time.Duration, callback func(), sigs ...os.Signal) *SigHandler

func (*SigHandler) Run

func (s *SigHandler) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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