web

package
v0.0.0-...-89b6d9c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module interface {
	Name() string
	Route(s Server) error
}

Module represents a module that can be added to a web server

type Server

type Server interface {
	HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route
	PathPrefix(tpl string) *mux.Route
	Start() error
	Stop(ctx context.Context) error
}

Server represents a http server

func New2

func New2(ctx context.Context) (Server, error)

New2 creates a new http 2 web server

func New3

func New3(ctx context.Context) (Server, error)

New3 creates a new http 3 web server

type Server2

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

Server2 is a http 2 web server

func (*Server2) HandleFunc

func (r *Server2) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route

HandleFunc attaches a function to a path

func (*Server2) PathPrefix

func (r *Server2) PathPrefix(path string) *mux.Route

PathPrefix attaches a new route url path prefix

func (*Server2) Start

func (r *Server2) Start() error

Start starts the web server

func (*Server2) Stop

func (r *Server2) Stop(ctx context.Context) error

Stop shuts down the web server

type Server3

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

Server3 is a http 3 web server

func (*Server3) HandleFunc

func (r *Server3) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route

HandleFunc attaches a function to a path

func (*Server3) PathPrefix

func (r *Server3) PathPrefix(path string) *mux.Route

PathPrefix attaches a new route url path prefix

func (*Server3) Start

func (r *Server3) Start() error

Start starts the web server

func (*Server3) Stop

func (r *Server3) Stop(ctx context.Context) error

Stop shuts down the web server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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