Help us shape the future of Go! Take the 2026 Go Developer Survey

status

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestIndicators []*health.Indicator // only for testing
)

Functions

func BytesToMiB

func BytesToMiB(b uint64) float64

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func (*API) Handler

func (api *API) Handler() http.Handler

func (*API) Health

func (api *API) Health(w http.ResponseWriter, r *http.Request)

func (*API) Status

func (api *API) Status(w http.ResponseWriter, r *http.Request)

type DatabaseStats

type DatabaseStats struct {
	TotalConnections  int `json:"total_connections"`
	ActiveConnections int `json:"active_connections"`
}

type EventStats

type EventStats struct {
	Pending int64 `json:"pending"`
}

type HealthResponse

type HealthResponse struct {
	Status     string                  `json:"status"`
	Components map[string]HealthResult `json:"components"`
}

type HealthResult

type HealthResult struct {
	Status string  `json:"status"`
	Error  *string `json:"error,omitempty"`
}

type MemoryStats

type MemoryStats struct {
	Alloc       string `json:"alloc"`
	Sys         string `json:"sys"`
	HeapAlloc   string `json:"heap_alloc"`
	HeapIdle    string `json:"heap_idle"`
	HeapInuse   string `json:"heap_inuse"`
	HeapObjects int64  `json:"heap_objects"`
	GC          int64  `json:"gc"`
}

type Options

type Options struct {
	AccessLog  accesslog.AccessLogger
	Indicators []*health.Indicator
}

type QueueStats

type QueueStats struct {
	Size           int64 `json:"size"`
	BacklogLatency int64 `json:"backlog_latency_secs"`
}

type RuntimeStats

type RuntimeStats struct {
	Go         string `json:"go"`
	Goroutines int    `json:"goroutines"`
}

type Status

type Status struct {
	// contains filtered or unexported fields
}

func NewStatus

func NewStatus(cfg modules.StatusConfig, opts Options) *Status

func (*Status) Name added in v1.0.1

func (s *Status) Name() string

func (*Status) Start

func (s *Status) Start() error

func (*Status) Stop

func (s *Status) Stop(ctx context.Context) error

type StatusResponse

type StatusResponse struct {
	UpTime                     string        `json:"uptime"`
	Runtime                    RuntimeStats  `json:"runtime"`
	Memory                     MemoryStats   `json:"memory"`
	Database                   DatabaseStats `json:"database"`
	InboundRequests            int64         `json:"inbound_requests"`
	InboundFailedRequests      int64         `json:"inbound_failed_requests"`
	OutboundRequests           int64         `json:"outbound_requests"`
	OutboundProcessingRequests int64         `json:"outbound_processing_requests"`
	OutboundFailedRequests     int64         `json:"outbound_failed_requests"`
	Queue                      QueueStats    `json:"queue"`
	Event                      EventStats    `json:"event"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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