www

package
v6.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: BSD-3-Clause Imports: 30 Imported by: 0

Documentation

Overview

package www implements HTTP handlers for the whosonfirst-browser web application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStaticAssetHandlers

func AppendStaticAssetHandlers(mux *http.ServeMux) error

func AppendStaticAssetHandlersWithPrefix

func AppendStaticAssetHandlersWithPrefix(mux *http.ServeMux, prefix string) error

func DataHandler

func DataHandler(root string) (http.Handler, error)

func DefaultRasterSizes

func DefaultRasterSizes() map[string]RasterSize

func DefaultSVGSizes

func DefaultSVGSizes() map[string]SVGSize

func GeoJSONHandler

func GeoJSONHandler(opts *GeoJSONHandlerOptions) (http.Handler, error)

func GeoJSONLDHandler

func GeoJSONLDHandler(opts *GeoJSONLDHandlerOptions) (http.Handler, error)

func IDHandler

func IDHandler(opts IDHandlerOptions) (http.Handler, error)

func IndexHandler

func IndexHandler(opts IndexHandlerOptions) (http.Handler, error)
func NavPlaceHandler(opts *NavPlaceHandlerOptions) (http.Handler, error)

NavPlaceHandler will return a given record as a FeatureCollection for use by the IIIF navPlace extension, specifically as navPlace "reference" objects.

func NewNullHandler

func NewNullHandler() http.Handler

func RasterHandler

func RasterHandler(opts *RasterHandlerOptions) (http.Handler, error)

func RenderTemplate

func RenderTemplate(rsp gohttp.ResponseWriter, t *template.Template, vars interface{})

func SPRHandler

func SPRHandler(opts *SPRHandlerOptions) (http.Handler, error)

func SVGHandler

func SVGHandler(opts *SVGHandlerOptions) (http.Handler, error)

func SearchAPIHandler

func SearchAPIHandler(opts SearchAPIHandlerOptions) (http.Handler, error)

func SearchHandler

func SearchHandler(opts SearchHandlerOptions) (http.Handler, error)

func SelectHandler

func SelectHandler(opts *SelectHandlerOptions) (http.Handler, error)

func StaticAssetsHandler

func StaticAssetsHandler() (http.Handler, error)

func StaticAssetsHandlerWithPrefix

func StaticAssetsHandlerWithPrefix(prefix string) (http.Handler, error)

func StaticFileSystem

func StaticFileSystem() (http.FileSystem, error)

func WebfingerHandler

func WebfingerHandler(opts *WebfingerHandlerOptions) (http.Handler, error)

Types

type Capabilities

type Capabilities struct {
	GeoJSON   bool
	GeoJSONLD bool
	PNG       bool
	SVG       bool
	NavPlace  bool
	Select    bool
	SPR       bool
	HTML      bool
}

type Endpoints

type Endpoints struct {
	Index     string
	Id        string
	Data      string
	Png       string
	Svg       string
	Spr       string
	Search    string
	NavPlace  string
	GeoJSONLD string
}

Endpoints defines a struct containing (relative) URLs for the various whosonfirst-browser web application handlers.

type ErrorVars

type ErrorVars struct {
	Error     error
	Endpoints *Endpoints
}

type GeoJSONHandlerOptions

type GeoJSONHandlerOptions struct {
	Reader reader.Reader
	Logger *log.Logger
}

type GeoJSONLDHandlerOptions

type GeoJSONLDHandlerOptions struct {
	Reader reader.Reader
	Logger *log.Logger
}

type IDHandlerOptions

type IDHandlerOptions struct {
	Templates   *template.Template
	Endpoints   *Endpoints
	Reader      reader.Reader
	Logger      *log.Logger
	MapProvider string
}

type IDVars

type IDVars struct {
	SPR          spr.StandardPlacesResult
	URI          string
	URIArgs      *uri.URIArgs
	IsAlternate  bool
	LastModified string
	Endpoints    *Endpoints
	MapProvider  string
}

type IndexHandlerOptions

type IndexHandlerOptions struct {
	Templates *template.Template
	Endpoints *Endpoints
}

type IndexVars

type IndexVars struct {
	Endpoints *Endpoints
}
type NavPlaceHandlerOptions struct {
	Reader      reader.Reader
	Logger      *log.Logger
	MaxFeatures int
}

type NotFoundVars

type NotFoundVars struct {
	Endpoints *Endpoints
}

type Paths

type Paths struct {
	PNG       string
	SVG       string
	GeoJSON   string
	GeoJSONLD string
	NavPlace  string
	SPR       string
	Select    string
	URIPrefix string
	HTML      string
}

type RasterHandlerOptions

type RasterHandlerOptions struct {
	Format string
	Sizes  map[string]RasterSize
	Reader reader.Reader
	Logger *log.Logger
}

type RasterSize

type RasterSize struct {
	Label     string
	MaxHeight int
	MaxWidth  int
}

type SPRHandlerOptions

type SPRHandlerOptions struct {
	Reader reader.Reader
	Logger *log.Logger
}

type SVGHandlerOptions

type SVGHandlerOptions struct {
	Sizes  map[string]SVGSize
	Reader reader.Reader
	Logger *log.Logger
}

type SVGSize

type SVGSize struct {
	Label     string
	MaxHeight int
	MaxWidth  int
}

type SearchAPIHandlerOptions

type SearchAPIHandlerOptions struct {
	Database        fulltext.FullTextDatabase
	EnableGeoJSON   bool
	GeoJSONReader   reader.Reader
	SPRPathResolver geojson.SPRPathResolver
}

type SearchHandlerOptions

type SearchHandlerOptions struct {
	Templates   *template.Template
	Endpoints   *Endpoints
	Database    fulltext.FullTextDatabase
	MapProvider string
}

type SearchVars

type SearchVars struct {
	Endpoints *Endpoints
	Query     string
	Results   []spr.StandardPlacesResult
}

type SelectHandlerOptions

type SelectHandlerOptions struct {
	Pattern *regexp.Regexp
	Reader  reader.Reader
	Logger  *log.Logger
}

type WebfingerHandlerOptions

type WebfingerHandlerOptions struct {
	Reader       reader.Reader
	Logger       *log.Logger
	Hostname     string
	Paths        *Paths
	Capabilities *Capabilities
}

Jump to

Keyboard shortcuts

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