server

package
v0.0.0-...-2c3b082 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxHeaderBytes    = 1024
	DefaultReadTimeout       = 1 * time.Second
	DefaultReadHeaderTimeout = 1 * time.Second
	DefaultWriteTimeout      = 2 * time.Second
	DefaultIdleTimeout       = 30 * time.Second
	DefaultAddress           = ""
	DefaultPort              = 3000
	DefaultTelemetryPort     = 9090
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IServer

type IServer interface {
	Start(handler http.Handler) error
	Stop(timeout time.Duration) error
}

type Server

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

Server is the server part of the application.

func New

func New(rt, rht, wt, it time.Duration, p, mhb int, loc string) *Server

New create a new server.

func (*Server) Start

func (s *Server) Start(handler http.Handler) error

Start starts the server on the provided listener.

func (*Server) Stop

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

Stop gracefully stops the server.

Directories

Path Synopsis
util

Jump to

Keyboard shortcuts

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