web

package module
v0.0.0-...-feaa6dc Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 8 Imported by: 0

README

web

This package implements an HTTP server that other web-based Jaunty services inherit from.

License

MIT

Documentation

Overview

Package web implements an HTTP server as a basis for web-based services.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOption = errors.New("web: invalid option given")

ErrInvalidOption is returned when a configuration option is not set or otherwise invalid.

Functions

This section is empty.

Types

type Server

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

Server is a barebones HTTP server.

func New

func New(addr string) (*Server, error)

New creates a new Server from the given Options.

func (*Server) Start

func (s *Server) Start(ctx context.Context, so ...StartOption) error

Start registers the given router as a server handler and begins to listen on the configured address.

Start adds a *zap.Logger onto the given context for use in request-scoped logging.

type StartOption

type StartOption func(*startParams)

StartOption sets start parameters on a *Server.

func Logger

func Logger(l *zap.Logger) StartOption

func Router

func Router(r *chi.Mux) StartOption

Jump to

Keyboard shortcuts

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