httpd

package
v0.2.31 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort      = "8080"
	DefaultPublicDir = "public"
	HealthPath       = "/health"
	RoutesPath       = "/_routes"
)

Variables

This section is empty.

Functions

func Gzip

Gzip middleware

func NewRouter

func NewRouter(mux *http.ServeMux) router.Router

func NoCache

func NoCache(next router.HandlerFunc) router.HandlerFunc

NoCache middleware

Types

type Config

type Config struct {
	Port      string
	PublicDir string // "" = no servir estáticos
	Gzip      bool
	NoCache   bool
	Health    bool
	Logger    func(...any)

	Authn          router.Middleware
	Authorize      model.Authorizer
	RoutesEndpoint bool

	TLS TLSConfig
}

type Server

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

func New

func New(c Config) *Server

func (*Server) Handler added in v0.2.23

func (s *Server) Handler() (http.Handler, error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Mount

func (s *Server) Mount(m ...router.APIModule) *Server

func (*Server) Router

func (s *Server) Router() router.Router

type TLSConfig

type TLSConfig struct {
	AutoCert bool
	Domain   string
	CertFile string
	KeyFile  string
	DevTLS   bool
}

Jump to

Keyboard shortcuts

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