statusManager

package
v0.0.0-...-33e56a9 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusManager

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

StatusManager is the struct defined to group and contain all the methods that interact with the status report subsystem. Parameters: - db: a DbParameter reference to be able to use the DBManager methods.

func New

New is the function to create the struct StatusManager. Parameters: - DbParameter: reference pointing to the DbParameter that allows the interaction with the DBManager methods. Returns: - StatusManager: struct to interact with statusManager subsystem functionalities.

func (*StatusManager) APIHit

func (m *StatusManager) APIHit(index string, t time.Time)

APIHit is meant to be called at the beginning of each endpoint function. Its job is to update the information about the last time that endpoint was called and the rest of the metrics for the endpoint in the subsystem. Parameters: - index: string for identifying the endpoint. Should be unique per endpoint and contained in the enum list in the swagger file - t: a time.Time timestamp with refering to the moment the endpoint was called.

func (*StatusManager) APIHitDone

func (m *StatusManager) APIHitDone(index string, t time.Time)

APIHit is meant to be called right before the return of each endpoint function. Its job is to update the average time spent on the processing of each endpoint. Parameters: - index: string for identifying the endpoint. Should be unique per endpoint and contained in the enum list in the swagger file - t: a time.Time timestamp with refering to the moment the endpoint was called. Returns: - key: the key for avgTime map track.

func (*StatusManager) GetStatus

GetStatus (Swagger func) is the function behind the API Endpoint /status/{id} It give the current hit-status of the selected endpoint and a primitive system and db connection status report.

func (*StatusManager) InitEndpoint

func (m *StatusManager) InitEndpoint(index string)

InitEndpoint is meant to be called on the New() functions representing each endpoint, its job is to initialize the endpoint index in the status array. Parameters: - index: string for identifying the endpoint. Should be unique per endpoint and contained in the enum list in the swagger file

func (*StatusManager) ShowStatus

ShowStatus (Swagger func) is the function behind the API Endpoint /status It give the current hit-status of the whole system and a primitive system and db connection status report.

Jump to

Keyboard shortcuts

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