Versions in this module Expand all Collapse all v0 v0.1.0 Nov 26, 2020 Changes in this version + func ContentHandler(site *Host, route Route) func(http.ResponseWriter, *http.Request) + func InitCache() *http.Server + func RunServer(listenAddress string, hostConfigFiles []string) + func WaitForSignal(srv *http.Server) + type Content struct + CacheKey string + CacheTTL string + JSON string + Replacements []Replacement + Selector string + Source string + Template string + func (c *Content) Caching() bool + func (c *Content) Fetch(site *Host, contextdata map[string]interface{}) (string, error) + func (c *Content) InterpolatedCacheKey(contextData map[string]interface{}) string + func (c *Content) Render(site *Host, contextdata map[string]interface{}) (string, error) + type ContentContextValue struct + Content *Content + ContextData map[string]interface{} + Site *Host + type DocumentFetcher interface + Fetch func() (string, error) + type FileFetcher struct + Path string + func (fetcher *FileFetcher) Fetch() (string, error) + type Host struct + Cache *groupcache.Group + Hostname string + MaxCache int64 + Routes []Route + func ParseHostHCL(src []byte, filename string) (c *Host, err error) + func ReadHostHCL(filename string) (c *Host, err error) + func (host *Host) Init() + type RenderedTemplateFetcher struct + DataURL string + RequestContext map[string]interface{} + SourceFetcher DocumentFetcher + Template *template.Template + func (fetcher *RenderedTemplateFetcher) Fetch() (string, error) + type Replacement struct + At string + Content Content + type Route struct + AllowBurst int + BotAllowBurst int + BotMaxRate float64 + MaxRate float64 + Path string + Source *Content + StaticPath *Static + func (route *Route) ContentHandler(site *Host, w http.ResponseWriter, r *http.Request) + func (route *Route) Init() + func (route *Route) Throttling(r *http.Request) bool + type Static struct + Directory string + type StringFetcher struct + Body string + func (fetcher *StringFetcher) Fetch() (string, error) + type URIFetcher struct + URI string + func (fetcher *URIFetcher) Fetch() (string, error)