Documentation
¶
Index ¶
- type StatusManager
- func (m *StatusManager) APIHit(index string, t time.Time)
- func (m *StatusManager) APIHitDone(index string, t time.Time)
- func (m *StatusManager) GetStatus(ctx context.Context, params status_management.GetStatusParams) middleware.Responder
- func (m *StatusManager) InitEndpoint(index string)
- func (m *StatusManager) ShowStatus(ctx context.Context, params status_management.ShowStatusParams) middleware.Responder
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 ¶
func New(db *dbManager.DbParameter) *StatusManager
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 ¶
func (m *StatusManager) GetStatus(ctx context.Context, params status_management.GetStatusParams) middleware.Responder
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 ¶
func (m *StatusManager) ShowStatus(ctx context.Context, params status_management.ShowStatusParams) middleware.Responder
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.