Documentation ¶
Overview ¶
service includes generic handlers, net/http and mux code for instances of servers with API endpoints further defined within their respective packages.
Index ¶
- type VulcanService
- func (vs *VulcanService) FavicoHandler(w http.ResponseWriter, r *http.Request)
- func (vs *VulcanService) HealthCheckHandler(w http.ResponseWriter, r *http.Request)
- func (vs *VulcanService) HomeHandler(w http.ResponseWriter, r *http.Request)
- func (vs *VulcanService) NotFoundHandler(w http.ResponseWriter, r *http.Request)
- func (vs *VulcanService) PageHandler(w http.ResponseWriter, r *http.Request)
- func (vs *VulcanService) RunVulcanServer()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VulcanService ¶
func NewVulcanService ¶
func NewVulcanService(instance string, address string) *VulcanService
Create a vulcan service with appropriate handlers. instance is a key that will be used in loading templates, static files, etc. address is the host and port to listen on
func (*VulcanService) FavicoHandler ¶
func (vs *VulcanService) FavicoHandler(w http.ResponseWriter, r *http.Request)
func (*VulcanService) HealthCheckHandler ¶
func (vs *VulcanService) HealthCheckHandler(w http.ResponseWriter, r *http.Request)
HealthCheckHandler provides a default health check response (in JSON) for the instance.
func (*VulcanService) HomeHandler ¶
func (vs *VulcanService) HomeHandler(w http.ResponseWriter, r *http.Request)
Home handler provides a default index handler for the instance.
func (*VulcanService) NotFoundHandler ¶
func (vs *VulcanService) NotFoundHandler(w http.ResponseWriter, r *http.Request)
NotFoundHandler provides a default not found handler for the instance.
func (*VulcanService) PageHandler ¶
func (vs *VulcanService) PageHandler(w http.ResponseWriter, r *http.Request)
Generic handler for /page/<page>.html requests, which reads from the root/web/<instance>/templates/<page>.html template.
func (*VulcanService) RunVulcanServer ¶
func (vs *VulcanService) RunVulcanServer()
Creates a new net/http service with a VulcanService configuration, then run the http.Server