service

package
v0.0.0-...-d1abe37 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VulcanService

type VulcanService struct {
	Router *mux.Router

	Instance string
	Address  string
}

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

Jump to

Keyboard shortcuts

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