services

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package provides a set of simple services that can be used the the http server.

Index

Constants

View Source
const (
	HealthRoute string = "/health"
)
View Source
const (
	MetricsRoute = "/metrics"
)
View Source
const (
	PProfRoute = "/debug/pprof/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Branch string `json:"branch"`
	Commit string `json:"commit"`
	Date   string `json:"date"`
	Go     string `json:"go"`
}

type Data

type Data struct {
	// swagger:allOf
	Build   `json:"build"`
	Name    string `json:"name"`
	Version string `json:"version"`
	Uptime  string `json:"uptime"`
}

type Health

type Health struct {
	Start time.Time
	Info  build.Information
}

Health reports on the health of the service as a whole.

func (Health) Name

func (Health) Name() string

Name returns the name of the service.

func (Health) Register

func (h Health) Register(router *mux.Router)

Register sets up the http handler for this service with the given router.

func (Health) Shutdown

func (Health) Shutdown(context.Context)

Shutdown is a no-op since there no long running processes for this service.

type HealthResponse

type HealthResponse struct {
	// swagger:allOf
	Data `json:"data"`
}

HealthResponse returns the status of the server, including the name, version, build details, and uptime.

swagger:response HealthResponse

type Metrics

type Metrics struct{}

Metrics that reports the metrics of the service.

func (Metrics) Name

func (Metrics) Name() string

Name returns the name of the service.

func (Metrics) Register

func (Metrics) Register(router *mux.Router)

Register sets up the http handler for this service with the given router.

func (Metrics) Shutdown

func (Metrics) Shutdown(context.Context)

Shutdown is a no-op since there are no long running processes.

type PProf

type PProf struct{}

func (PProf) Name

func (PProf) Name() string

Name returns the name of the service.

func (PProf) Register

func (p PProf) Register(router *mux.Router)

Register sets up the http handler for this service with the given router.

func (PProf) Shutdown

func (PProf) Shutdown(context.Context)

Shutdown is a no-op since there no long running processes for this service.

Jump to

Keyboard shortcuts

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