Documentation
¶
Overview ¶
Package handler provides the http handlers for handling HTTP requests for Go Vanity imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the request handler.
func Init ¶
Init initializes the global handler. This is non-idiomatic but is optimised for google cloud functions. The config is parsed from a yaml file that is; - Fetched from an external source (an HTTP endpoint). - Present locally on the filesystem If both options are provided, the local file is ignored.
func (*Handler) HandleImport ¶
func (h *Handler) HandleImport(w http.ResponseWriter, r *http.Request)
HandleImport handles Go's vanity import requests.
func (*Handler) HandleIndex ¶
func (h *Handler) HandleIndex(w http.ResponseWriter, r *http.Request)
HandleIndex serves the list of all supported paths for this host. This is in response to the `/` path.