Documentation ¶
Index ¶
- func JsonErrorHandler(err string, code int) http.Handler
- func Observability() http.Handler
- func StaticInfo(inf map[string]interface{}) (http.Handler, error)
- func StatusErr(status int) http.Handler
- func TemplateWithRequest(inTmpl string, data func(r *http.Request) map[string]interface{}) func(w http.ResponseWriter, r *http.Request)
- type HttpErr
- type Info
- type Link
- type SimpleText
- type SpaHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Observability ¶
Observability handler adds an /metrics endpoint for prometheus other observability features can and will be added in the future
func StaticInfo ¶
StaticInfo is a handler that will render a static map[string]any to an endpoint this is useful to expose static information like build version, or enabled/disabled features that won't change over the lifecycle of the application and indicate the clients how to behave, e.g. if authentication is disabled.
func TemplateWithRequest ¶
Types ¶
type SimpleText ¶
SimpleText Is a simple handler that will print a list of navigation destination based on the map passed upon creation.
func (SimpleText) ServeHTTP ¶
func (h SimpleText) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SpaHandler ¶
type SpaHandler struct {
// contains filtered or unexported fields
}
func NewSpaHAndler ¶
func NewSpaHAndler(inputFs fs.FS, fsSubDir, pathPrefix string) (SpaHandler, error)
func (SpaHandler) ServeHTTP ¶
func (h SpaHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.