app: github.com/maxence-charriere/app/internal/http Index | Files

package http

import "github.com/maxence-charriere/app/internal/http"

Index

Package Files

cache.go file.go gzip.go manifest.go page.go route.go templates.go

func CacheHandler Uses

func CacheHandler(h http.Handler, webDir string) http.Handler

CacheHandler returns a decorated version of the given cache that injects cache related headers.

func FileHandler Uses

func FileHandler(webDir string) http.Handler

FileHandler returns a handler that serves files located in the web directory.

func GenerateEtag Uses

func GenerateEtag() string

GenerateEtag generates an etag.

func GetEtag Uses

func GetEtag(webDir string) string

GetEtag returns the etag for the given web directory.

func GzipHandler Uses

func GzipHandler(h http.Handler, webDir string) http.Handler

GzipHandler returns a decorated version of the given handler that serves available gzipped static resources.

type ManifestHandler Uses

type ManifestHandler struct {
    BackgroundColor string
    Name            string
    Orientation     string
    ShortName       string
    Scope           string
    StartURL        string
    ThemeColor      string
    // contains filtered or unexported fields
}

ManifestHandler is a handler that serves a manifest file for progressive webapp support.

func (*ManifestHandler) ServeHTTP Uses

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

type PageHandler Uses

type PageHandler struct {
    Author       string
    Description  string
    Icon         string
    Keywords     []string
    LoadingLabel string
    Name         string
    ThemeColor   string
    WebDir       string
    // contains filtered or unexported fields
}

PageHandler is a handler that serves pages that works with wasm app.

func (*PageHandler) ServeHTTP Uses

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

type RouteHandler Uses

type RouteHandler struct {
    Files    http.Handler
    Pages    http.Handler
    Manifest http.Handler
    WebDir   string
}

RouteHandler is a handler that routes requests to the appropriate handler.

func (*RouteHandler) ServeHTTP Uses

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

Package http imports 14 packages (graph) and is imported by 1 packages. Updated 2019-09-11. Refresh now. Tools for package owners.