controllers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOK                 string = "OK"
	StatusPartiallyAvailable string = "Partially Available"
	StatusUnavailable        string = "Unavailable"
	StatusTimeout            string = "Timeout during health check"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check added in v1.0.1

type Check struct {
	// Status is the check status.
	Status string `json:"status"`
	// Timestamp is the time in which the check occurred.
	Timestamp string `json:"timestamp"`
	// StartUp is the time to boot up the system.
	StartUp string `json:"startup"`
	// Uptime is the time in which the check occurred.
	Uptime string `json:"uptime"`
	// Failures holds the failed checks along with their messages.
	Failures map[string]string `json:"failures,omitempty"`
	// System holds information of the go process.
	System `json:"system"`
}

Check represents the health check response.

func NewCheck added in v1.0.1

func NewCheck(status string, failures map[string]string, startTime time.Time, bootTime time.Duration) Check

NewCheck returns a new HealthCheck struct

type HealthCheck added in v1.0.1

type HealthCheck interface {
	HealthCheck(ctx *gin.Context, startTime time.Time, bootTime time.Duration)
}

func NewHealthCheck added in v1.0.1

func NewHealthCheck() HealthCheck

type Message

type Message interface {
	Add(ctx *gin.Context)
	Get(ctx *gin.Context)
	GetAndRead(ctx *gin.Context)
	GetAll(ctx *gin.Context)
	Update(ctx *gin.Context)
	Delete(ctx *gin.Context)
}

func NewMessage

func NewMessage(messageRepo repository.MessageRepo) Message

NewMessage returns a new message controller

type System added in v1.0.1

type System struct {
	// Version is the go version.
	Version string `json:"version"`
	// GoroutinesCount is the number of the current goroutines.
	GoroutinesCount int `json:"goroutines_count"`
	// TotalAllocBytes is the total bytes allocated.
	TotalAllocBytes int `json:"total_alloc_bytes"`
	// HeapObjectsCount is the number of objects in the go heap.
	HeapObjectsCount int `json:"heap_objects_count"`
	// TotalAllocBytes is the bytes allocated and not yet freed.
	AllocBytes int `json:"alloc_bytes"`
}

System runtime variables about the go process.

func NewSystemMetrics added in v1.0.1

func NewSystemMetrics() System

NewSystemMetrics returns a new SystemMetrics struct

type Views added in v1.0.1

type Views interface {
	Index(ctx *gin.Context)
	NotFound(ctx *gin.Context)
	ShowMessage(ctx *gin.Context)
	AddMessage(ctx *gin.Context)
}

func NewViews added in v1.0.1

func NewViews(messageRepo repository.MessageRepo) Views

Jump to

Keyboard shortcuts

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