site

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, r *http.Request, err error)

Types

type Handler

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

func NewHandler

func NewHandler(ctx context.Context, logger *zap.Logger, resolver site.Resolver, conf HandlerConfig) (*Handler, error)

func (*Handler) AllowAnyDomain

func (h *Handler) AllowAnyDomain() bool

func (*Handler) CheckValidDomain

func (h *Handler) CheckValidDomain(name string) error

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HandlerConfig

type HandlerConfig struct {
	HostPattern string
	Middlewares []Middleware
}

type Middleware

type Middleware func(site.FS, http.Handler) http.Handler

type SiteHandler

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

func NewSiteHandler

func NewSiteHandler(desc *site.Descriptor, middlewares []Middleware) *SiteHandler

func (*SiteHandler) ID

func (h *SiteHandler) ID() string

func (*SiteHandler) ServeHTTP

func (h *SiteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ref http.fileHandler.ServeHTTP

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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