server

package
v0.0.0-...-6e5bb36 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 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 IServer

type IServer interface {
	Router(handler handler.IHandler) (w wrapper.IWrapper)
	GetHTTPServer() *http.Server
	GracefullShutdown(server *http.Server, logger *log.Logger, quit <-chan os.Signal, done chan<- bool)
}

IServer ...

func New

func New(opts ...Option) IServer

New ...

type Option

type Option func(*Server)

Option ...

func WithDefault

func WithDefault(logger *log.Logger, addr string, handler handler.IHandler, readTimeout, writeTimeout, idleTimeout int) Option

WithDefault ...

type Server

type Server struct {
	ErrorLog     *log.Logger
	Addr         string
	Handler      handler.IHandler
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	IdleTimeout  time.Duration
}

Server will create a http.Server from the Go standard library

func (*Server) GetHTTPServer

func (s *Server) GetHTTPServer() *http.Server

GetHTTPServer ...

func (*Server) GracefullShutdown

func (s *Server) GracefullShutdown(server *http.Server, logger *log.Logger, quit <-chan os.Signal, done chan<- bool)

GracefullShutdown ...

func (*Server) Router

func (s *Server) Router(handler handler.IHandler) (w wrapper.IWrapper)

Router ...

Jump to

Keyboard shortcuts

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