server

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option is an HTTP server option.

func Address

func Address(addr string) Option

Address with server address.

func Handler

func Handler(hander http.Handler) Option

Handler with server handler.

func StopTimeout

func StopTimeout(t time.Duration) Option

StopTimeout with server stopTimeout.

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

func (*Server) Start

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

func (*Server) Stop

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

Jump to

Keyboard shortcuts

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