www

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

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 GeoJSONHandler

func GeoJSONHandler(r reader.Reader) (http.Handler, error)

func GeoJSONLDHandler

func GeoJSONLDHandler(r reader.Reader) (http.Handler, error)

func IDHandler

func IDHandler(r reader.Reader, opts IDHandlerOptions) (http.Handler, error)

func IndexHandler

func IndexHandler(opts IndexHandlerOptions) (http.Handler, error)
func NavPlaceHandler(r reader.Reader) (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 RasterHandler

func RasterHandler(r reader.Reader, opts *RasterOptions) (http.Handler, error)

func RenderTemplate

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

func SPRHandler

func SPRHandler(r reader.Reader) (http.Handler, error)

func SVGHandler

func SVGHandler(r reader.Reader, handler_opts *SVGOptions) (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(r reader.Reader, 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)

Types

type Endpoints

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

type ErrorVars

type ErrorVars struct {
	Error     error
	Endpoints *Endpoints
}

type IDHandlerOptions

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

type IDVars

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

type IndexHandlerOptions

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

type IndexVars

type IndexVars struct {
	Endpoints *Endpoints
}

type NotFoundVars

type NotFoundVars struct {
	Endpoints *Endpoints
}

type RasterOptions

type RasterOptions struct {
	Format string
	Sizes  map[string]RasterSize
}

func NewDefaultRasterOptions

func NewDefaultRasterOptions() (*RasterOptions, error)

type RasterSize

type RasterSize struct {
	Label     string
	MaxHeight int
	MaxWidth  int
}

type SVGOptions

type SVGOptions struct {
	Sizes map[string]SVGSize
}

func NewDefaultSVGOptions

func NewDefaultSVGOptions() (*SVGOptions, error)

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
}

type SearchVars

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

type SelectHandlerOptions

type SelectHandlerOptions struct {
	Pattern *regexp.Regexp
}

type URI

type URI struct {
	Id          int64
	URI         string
	Feature     geojson.Feature
	URIArgs     *uri.URIArgs
	IsAlternate bool
}

func ParseURIFromRequest

func ParseURIFromRequest(req *http.Request, r reader.Reader) (*URI, error, int)

Jump to

Keyboard shortcuts

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