httpserver

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

func WithAddr

func WithAddr(addr string) Option

func WithHTTP1 added in v0.0.18

func WithHTTP1(v bool) Option

func WithHTTP2 added in v0.0.18

func WithHTTP2(v bool) Option

func WithListener

func WithListener(lis net.Listener) Option

func WithRandomLocalAddr

func WithRandomLocalAddr() Option

func WithUnencryptedHTTP2 added in v0.0.18

func WithUnencryptedHTTP2(v bool) Option

type Server

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

func New

func New(opts ...Option) *Server

func (*Server) Handle

func (s *Server) Handle(pattern string, handler http.Handler)

func (*Server) HandleFunc

func (s *Server) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

func (*Server) Listener

func (s *Server) Listener() net.Listener

func (*Server) Run

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

Jump to

Keyboard shortcuts

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