Documentation
¶
Overview ¶
Package gen contains generated code for the health API.
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
Index ¶
- Constants
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type AgentDetail
- type AgentStats
- type ComponentEntry
- type ComponentHealth
- type ConsumerDetail
- type ConsumerStats
- type EchoRouter
- type ErrorResponse
- type GetHealth200JSONResponse
- type GetHealthReady200JSONResponse
- type GetHealthReady503JSONResponse
- type GetHealthReadyRequestObject
- type GetHealthReadyResponseObject
- type GetHealthRequestObject
- type GetHealthResponseObject
- type GetHealthStatus200JSONResponse
- type GetHealthStatus401JSONResponse
- type GetHealthStatus403JSONResponse
- type GetHealthStatus503JSONResponse
- type GetHealthStatusRequestObject
- type GetHealthStatusResponseObject
- type HealthResponse
- type JobStats
- type KVBucketInfo
- type NATSInfo
- type ObjectStoreInfo
- type ReadyResponse
- type ServerInterface
- type ServerInterfaceWrapper
- type StatusResponse
- type StreamInfo
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
Constants ¶
const (
BearerAuthScopes = "BearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type AgentDetail ¶
type AgentDetail struct {
// Hostname Agent hostname.
Hostname string `json:"hostname"`
// Labels Formatted label string.
Labels *string `json:"labels,omitempty"`
// Registered Time since last heartbeat registration.
Registered string `json:"registered"`
}
AgentDetail defines model for AgentDetail.
type AgentStats ¶
type AgentStats struct {
// Agents Per-agent registration details.
Agents *[]AgentDetail `json:"agents,omitempty"`
// Ready Number of agents with Ready status.
Ready int `json:"ready"`
// Total Total number of registered agents.
Total int `json:"total"`
}
AgentStats defines model for AgentStats.
type ComponentEntry ¶
type ComponentEntry struct {
// Age Time since component started.
Age *string `json:"age,omitempty"`
// Conditions Active conditions.
Conditions *[]string `json:"conditions,omitempty"`
// CpuPercent Process CPU usage percentage.
CpuPercent *float32 `json:"cpu_percent,omitempty"`
// Hostname Component hostname.
Hostname *string `json:"hostname,omitempty"`
// MemBytes Process RSS memory in bytes.
MemBytes *int64 `json:"mem_bytes,omitempty"`
// Status Component status.
Status *string `json:"status,omitempty"`
// Type Component type (agent, api, nats).
Type *string `json:"type,omitempty"`
}
ComponentEntry defines model for ComponentEntry.
type ComponentHealth ¶
type ComponentHealth struct {
// Address Listen address of the component (if applicable).
Address *string `json:"address,omitempty"`
// Error Error message when component is unhealthy.
Error *string `json:"error,omitempty"`
// Status Component health status.
Status string `json:"status"`
}
ComponentHealth defines model for ComponentHealth.
type ConsumerDetail ¶
type ConsumerDetail struct {
// AckPending Messages delivered but not yet acknowledged.
AckPending int `json:"ack_pending"`
// Name Consumer name.
Name string `json:"name"`
// Pending Messages not yet delivered.
Pending int `json:"pending"`
// Redelivered Messages redelivered and not yet acknowledged.
Redelivered int `json:"redelivered"`
}
ConsumerDetail defines model for ConsumerDetail.
type ConsumerStats ¶
type ConsumerStats struct {
// Consumers Per-consumer details.
Consumers *[]ConsumerDetail `json:"consumers,omitempty"`
// Total Total number of JetStream consumers.
Total int `json:"total"`
}
ConsumerStats defines model for ConsumerStats.
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type ErrorResponse ¶
type ErrorResponse = externalRef0.ErrorResponse
ErrorResponse defines model for ErrorResponse.
type GetHealth200JSONResponse ¶
type GetHealth200JSONResponse HealthResponse
func (GetHealth200JSONResponse) VisitGetHealthResponse ¶
func (response GetHealth200JSONResponse) VisitGetHealthResponse(w http.ResponseWriter) error
type GetHealthReady200JSONResponse ¶
type GetHealthReady200JSONResponse ReadyResponse
func (GetHealthReady200JSONResponse) VisitGetHealthReadyResponse ¶
func (response GetHealthReady200JSONResponse) VisitGetHealthReadyResponse(w http.ResponseWriter) error
type GetHealthReady503JSONResponse ¶
type GetHealthReady503JSONResponse ReadyResponse
func (GetHealthReady503JSONResponse) VisitGetHealthReadyResponse ¶
func (response GetHealthReady503JSONResponse) VisitGetHealthReadyResponse(w http.ResponseWriter) error
type GetHealthReadyRequestObject ¶
type GetHealthReadyRequestObject struct {
}
type GetHealthReadyResponseObject ¶
type GetHealthReadyResponseObject interface {
VisitGetHealthReadyResponse(w http.ResponseWriter) error
}
type GetHealthRequestObject ¶
type GetHealthRequestObject struct {
}
type GetHealthResponseObject ¶
type GetHealthResponseObject interface {
VisitGetHealthResponse(w http.ResponseWriter) error
}
type GetHealthStatus200JSONResponse ¶
type GetHealthStatus200JSONResponse StatusResponse
func (GetHealthStatus200JSONResponse) VisitGetHealthStatusResponse ¶
func (response GetHealthStatus200JSONResponse) VisitGetHealthStatusResponse(w http.ResponseWriter) error
type GetHealthStatus401JSONResponse ¶
type GetHealthStatus401JSONResponse externalRef0.ErrorResponse
func (GetHealthStatus401JSONResponse) VisitGetHealthStatusResponse ¶
func (response GetHealthStatus401JSONResponse) VisitGetHealthStatusResponse(w http.ResponseWriter) error
type GetHealthStatus403JSONResponse ¶
type GetHealthStatus403JSONResponse externalRef0.ErrorResponse
func (GetHealthStatus403JSONResponse) VisitGetHealthStatusResponse ¶
func (response GetHealthStatus403JSONResponse) VisitGetHealthStatusResponse(w http.ResponseWriter) error
type GetHealthStatus503JSONResponse ¶
type GetHealthStatus503JSONResponse StatusResponse
func (GetHealthStatus503JSONResponse) VisitGetHealthStatusResponse ¶
func (response GetHealthStatus503JSONResponse) VisitGetHealthStatusResponse(w http.ResponseWriter) error
type GetHealthStatusRequestObject ¶
type GetHealthStatusRequestObject struct {
}
type GetHealthStatusResponseObject ¶
type GetHealthStatusResponseObject interface {
VisitGetHealthStatusResponse(w http.ResponseWriter) error
}
type HealthResponse ¶
type HealthResponse struct {
// Status Health status.
Status string `json:"status"`
}
HealthResponse defines model for HealthResponse.
type JobStats ¶
type JobStats struct {
// Completed Number of completed jobs.
Completed int `json:"completed"`
// Dlq Number of jobs in the dead letter queue.
Dlq int `json:"dlq"`
// Failed Number of failed jobs.
Failed int `json:"failed"`
// Processing Number of jobs currently processing.
Processing int `json:"processing"`
// Total Total number of jobs.
Total int `json:"total"`
// Unprocessed Number of unprocessed jobs.
Unprocessed int `json:"unprocessed"`
}
JobStats defines model for JobStats.
type KVBucketInfo ¶
type KVBucketInfo struct {
// Bytes Total bytes in the bucket.
Bytes int `json:"bytes"`
// Keys Number of keys in the bucket.
Keys int `json:"keys"`
// Name KV bucket name.
Name string `json:"name"`
}
KVBucketInfo defines model for KVBucketInfo.
type NATSInfo ¶
type NATSInfo struct {
// Url Connected NATS server URL.
Url string `json:"url"`
// Version NATS server version.
Version string `json:"version"`
}
NATSInfo defines model for NATSInfo.
type ObjectStoreInfo ¶
type ObjectStoreInfo struct {
// Name Object Store bucket name.
Name string `json:"name"`
// Size Total bytes in the store.
Size int `json:"size"`
}
ObjectStoreInfo defines model for ObjectStoreInfo.
type ReadyResponse ¶
type ReadyResponse struct {
// Error Error message when not ready.
Error *string `json:"error,omitempty"`
// Status Readiness status.
Status string `json:"status"`
}
ReadyResponse defines model for ReadyResponse.
type ServerInterface ¶
type ServerInterface interface {
// Liveness probe
// (GET /api/health)
GetHealth(ctx echo.Context) error
// Readiness probe
// (GET /api/health/ready)
GetHealthReady(ctx echo.Context) error
// System status and component health
// (GET /api/health/status)
GetHealthStatus(ctx echo.Context) error
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetHealth ¶
func (w *ServerInterfaceWrapper) GetHealth(ctx echo.Context) error
GetHealth converts echo context to params.
func (*ServerInterfaceWrapper) GetHealthReady ¶
func (w *ServerInterfaceWrapper) GetHealthReady(ctx echo.Context) error
GetHealthReady converts echo context to params.
func (*ServerInterfaceWrapper) GetHealthStatus ¶
func (w *ServerInterfaceWrapper) GetHealthStatus(ctx echo.Context) error
GetHealthStatus converts echo context to params.
type StatusResponse ¶
type StatusResponse struct {
Agents *AgentStats `json:"agents,omitempty"`
// Components Per-component health status.
Components map[string]ComponentHealth `json:"components"`
Consumers *ConsumerStats `json:"consumers,omitempty"`
Jobs *JobStats `json:"jobs,omitempty"`
// KvBuckets KV bucket statistics.
KvBuckets *[]KVBucketInfo `json:"kv_buckets,omitempty"`
Nats *NATSInfo `json:"nats,omitempty"`
// ObjectStores Object Store statistics.
ObjectStores *[]ObjectStoreInfo `json:"object_stores,omitempty"`
// Registry All registered components with health details.
Registry *[]ComponentEntry `json:"registry,omitempty"`
// Status Overall health status.
Status string `json:"status"`
// Streams JetStream stream statistics.
Streams *[]StreamInfo `json:"streams,omitempty"`
// Uptime Time since server started.
Uptime string `json:"uptime"`
// Version Application version.
Version string `json:"version"`
}
StatusResponse defines model for StatusResponse.
type StreamInfo ¶
type StreamInfo struct {
// Bytes Total bytes in the stream.
Bytes int `json:"bytes"`
// Consumers Number of consumers on the stream.
Consumers int `json:"consumers"`
// Messages Number of messages in the stream.
Messages int `json:"messages"`
// Name Stream name.
Name string `json:"name"`
}
StreamInfo defines model for StreamInfo.
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Liveness probe
// (GET /api/health)
GetHealth(ctx context.Context, request GetHealthRequestObject) (GetHealthResponseObject, error)
// Readiness probe
// (GET /api/health/ready)
GetHealthReady(ctx context.Context, request GetHealthReadyRequestObject) (GetHealthReadyResponseObject, error)
// System status and component health
// (GET /api/health/status)
GetHealthStatus(ctx context.Context, request GetHealthStatusRequestObject) (GetHealthStatusResponseObject, error)
}
StrictServerInterface represents all server handlers.