reststats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatsServiceName rest.ServiceName = "stats"

StatsServiceName defines the service name for the Stats service.

Functions

func RegisterGetDatabaseStatsHandler

func RegisterGetDatabaseStatsHandler(n *Namespace) error

RegisterGetDatabaseStatsHandler registers the endpoint to retrieve database statistics

func RegisterGlobalStatusHandler added in v1.0.0

func RegisterGlobalStatusHandler(n *Namespace) error

RegisterGlobalStatusHandler registers the endpoint to retrieve global service statuses

Types

type GlobalStatus added in v1.0.0

type GlobalStatus struct {
	Status bool `json:"status" doc:"Global service status"`
}

type Namespace

type Namespace struct {
	*rest.Server
	// contains filtered or unexported fields
}

Namespace represents a service namespace containing configuration and dependencies for the Stats service.

func NewNamespace

func NewNamespace(server *rest.Server, db db.Adapter, pool *clients.ClientPool, nats *nats.Conn, cache *cache.Redis) *Namespace

NewNamespace creates a new instance of Namespace with the provided server, database adapter, client pool, NATS connection, and Redis cache.

func (*Namespace) GetName

func (s *Namespace) GetName() rest.ServiceName

GetName returns the service name for the Stats namespace.

func (*Namespace) RegisterHandlers

func (s *Namespace) RegisterHandlers() error

RegisterHandlers registers all the necessary handlers for the Stats namespace.

Jump to

Keyboard shortcuts

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