Documentation
¶
Overview ¶
Package version registers a stable JSON version endpoint.
NewHandler accepts a Config with path and ports.VersionInfo values. Register the handler on a router that supports method-based route registration, or use Handler directly when composing with net/http.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Path string
Info ports.VersionInfo
}
Config controls how the version endpoint is registered.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler wires the version endpoint.
func NewHandler ¶
NewHandler constructs a Handler from the provided config.
func (*Handler) Handler ¶
func (h *Handler) Handler() http.HandlerFunc
Handler returns an HTTP handler that writes the version info JSON.
func (*Handler) RegisterRoutes ¶
func (h *Handler) RegisterRoutes(router interface { Get(pattern string, h http.HandlerFunc) })
RegisterRoutes mounts the handler on the router.
func (*Handler) RegisterRoutesTo ¶ added in v2.1.0
func (h *Handler) RegisterRoutesTo(router ports.MethodRouteRegistrar)
RegisterRoutesTo mounts the handler on a minimal route registrar.
Click to show internal directories.
Click to hide internal directories.