httpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package httpserver implements HTTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

func Port

func Port(port int) Option

Port overrides the default port

func ReadTimeout

func ReadTimeout(timeout time.Duration) Option

ReadTimeout overrides the default read timeout

func ShutdownTimeout

func ShutdownTimeout(timeout time.Duration) Option

ShutdownTimeout overrides the default shutdown timeout

func WriteTimeout

func WriteTimeout(timeout time.Duration) Option

WriteTimeout overrides the default write timeout

type Server

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

Server represents an HTTP server instance

func New

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

New creates a new instance of Server

func (*Server) Notify

func (s *Server) Notify() <-chan error

Notify returns a channel which listens for the Server close event

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the Server

Jump to

Keyboard shortcuts

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