web

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 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 added in v0.0.5

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

New2 creates a new http 2 web server

func New3 added in v0.0.5

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

New3 creates a new http 3 web server

type Server2 added in v0.0.5

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

Server2 is a http 2 web server

func (*Server2) HandleFunc added in v0.0.5

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

HandleFunc attaches a function to a path

func (*Server2) PathPrefix added in v0.0.5

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

PathPrefix attaches a new route url path prefix

func (*Server2) Start added in v0.0.5

func (r *Server2) Start() error

Start starts the web server

func (*Server2) Stop added in v0.0.5

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

Stop shuts down the web server

type Server3 added in v0.0.5

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

Server3 is a http 3 web server

func (*Server3) HandleFunc added in v0.0.5

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

HandleFunc attaches a function to a path

func (*Server3) PathPrefix added in v0.0.5

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

PathPrefix attaches a new route url path prefix

func (*Server3) Start added in v0.0.5

func (r *Server3) Start() error

Start starts the web server

func (*Server3) Stop added in v0.0.5

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