server

package
v0.0.0-...-25a1aa9 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const DefaultPort = 9090

Variables

This section is empty.

Functions

func WaitForShutdown

func WaitForShutdown(ctx context.Context, srv *http.Server, timeout time.Duration) error

Types

type Config

type Config struct {
	Host string `json:"host" yaml:"host"`
	Port int    `json:"port" yaml:"port"`
}

type Server

type Server struct {
	*http.Server
}

func New

func New(cfg *Config) *Server

func NewHTTP2

func NewHTTP2(cfg *Config, conf *http2.Server) (*Server, error)

func (*Server) Run

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

func (*Server) RunAndStop

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

func (*Server) RunTLS

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

func (*Server) RunTLSAndStop

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

Jump to

Keyboard shortcuts

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