http

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*http.Server
	// The object providing the listeners for this server
	Listeners netutil.StreamListener

	// Optionally set a name to by used in logging
	Name string
	// contains filtered or unexported fields
}

Server wraps around gone/http/graceful HTTP server implementing gone/the daemon/srv.Server interface If ErrorLog is set, errors will be logged to it.

func (*Server) Description

func (s *Server) Description() string

Description implements a default textual description for a Server objects describing what it's up to.

func (*Server) Listen

func (s *Server) Listen() (err error)

Listen make the server listen on the listeners returned by the object set in in the Listeners attribute. If Listeners is nil, the server will listen on the Addr attribute possibly wrapped with TLSConfig

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) (err error)

Serve will call net/http.Server.Serve() on all listeners, closing the listeners when the context is canceled to make Serve() exit. This method exits when all underlying Serve() calls have exited.

Directories

Path Synopsis
handlers

Jump to

Keyboard shortcuts

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