site

package
v0.0.0-...-9db42c9 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr(a string) func(s *Site)

func Listener

func Listener(l net.Listener) func(s *Site)

func Logger

func Logger(l *slog.Logger) func(s *Site)

func ServeMux

func ServeMux(h httpServeMux) func(s *Site)

func Server

func Server(h httpServer) func(s *Site)

func Stderr

func Stderr(f io.Writer) func(s *Site)

func Stdout

func Stdout(f io.Writer) func(s *Site)

Types

type Site

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

func NewSite

func NewSite(cfgs ...SiteConfig) *Site

func (*Site) Handle

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

func (*Site) HandleFunc

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

func (*Site) ListenAndServe

func (s *Site) ListenAndServe() error

func (*Site) ListenAndServeTLS

func (s *Site) ListenAndServeTLS(certFile, keyFile string) error

func (*Site) Logger

func (s *Site) Logger() *slog.Logger

func (*Site) Serve

func (s *Site) Serve(l net.Listener) error

func (*Site) ServeTLS

func (s *Site) ServeTLS(l net.Listener, certFile, keyFile string) error

func (*Site) Shutdown

func (s *Site) Shutdown(ctx context.Context) error

type SiteConfig

type SiteConfig func(*Site)

Jump to

Keyboard shortcuts

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