httpserver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_WRITE_TIMEOUT       = 4 * time.Second
	DEFAULT_READ_TIMEOUT        = 4 * time.Second
	DEFAULT_HEADER_READ_TIMEOUT = 2 * time.Second
	DEFAULT_ADDRES              = ":8080"
	DEFAULT_EXIT_TIMEOUT        = 3 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpServerOption

type HttpServerOption func(*Server)

func WithExitTimeOut

func WithExitTimeOut(t time.Duration) HttpServerOption

func WithPort

func WithPort(port string) HttpServerOption

func WithReadHeaderTimeOout

func WithReadHeaderTimeOout(t time.Duration) HttpServerOption

func WithReadTimeOut

func WithReadTimeOut(t time.Duration) HttpServerOption

func WithWriteTimeOut

func WithWriteTimeOut(t time.Duration) HttpServerOption

type Server

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

TODO: Add logger

func New

func New(handler http.Handler, opts ...HttpServerOption) *Server

func (*Server) Exit

func (s *Server) Exit() error

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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