ahttp

package
v0.0.0-...-037b315 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterFunc

type FilterFunc func(http.Handler) http.Handler

func FilterChain

func FilterChain(filters ...FilterFunc) FilterFunc

type Option

type Option func(s *Server)

func Filters

func Filters(filters ...FilterFunc) Option

func Listen

func Listen(lis net.Listener) Option

func Network

func Network(network string) Option

func PProf

func PProf(pf bool) Option

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

func GetServer

func GetServer() *Server

func New

func New(address string, opts ...Option) (srv *Server, err error)

func (*Server) Endpoint

func (s *Server) Endpoint() (*url.URL, error)

func (*Server) Handle

func (s *Server) Handle(path string, h http.Handler)

Handle registers a new route with a matcher for the URL path.

func (*Server) HandleFunc

func (s *Server) HandleFunc(path string, h http.HandlerFunc)

HandleFunc registers a new route with a matcher for the URL path.

func (*Server) HandleFuncPrefix

func (s *Server) HandleFuncPrefix(prefix string, h http.HandlerFunc)

HandleFuncPrefix registers a new route with a matcher for the URL path prefix.

func (*Server) HandlePrefix

func (s *Server) HandlePrefix(prefix string, h http.Handler)

HandlePrefix registers a new route with a matcher for the URL path prefix.

func (*Server) Name

func (s *Server) Name() string

func (*Server) Start

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

func (*Server) Stop

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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