backend

package
v0.0.0-...-d3c53b9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	WeatherAPIKey string
	// Use composition and embedding to extend the API base
	api.Base
}

API is the main backend application API

func (*API) AddRoutes

func (a *API) AddRoutes(router *mux.Router)

Adds backend app routes

type HTTPError

type HTTPError struct {
	Error string `json:"error"`
}

HTTPError holds API JSON error

type Metrics

type Metrics struct {
	MemTotal     uint64  `json:"memTotal"`
	MemUsed      uint64  `json:"memUsed"`
	CPUPerc      float64 `json:"cpuPerc"`
	DiskTotal    uint64  `json:"diskTotal"`
	DiskFree     uint64  `json:"diskFree"`
	NetBytesSent uint64  `json:"netBytesSent"`
	NetBytesRecv uint64  `json:"netBytesRecv"`
}

Metrics are real time system counters

type SysInfo

type SysInfo struct {
	Hostname      string   `json:"hostname"`
	Platform      string   `json:"platform"`
	OS            string   `json:"os"`
	Uptime        uint64   `json:"uptime"`
	Arch          string   `json:"architecture"`
	CPUs          int      `json:"cpuCount"`
	CPUModel      string   `json:"cpuModel"`
	Mem           uint64   `json:"mem"`
	GoVersion     string   `json:"goVersion"`
	NetRemoteAddr string   `json:"netRemoteAddress"`
	NetHost       string   `json:"netHost"`
	IsContainer   bool     `json:"isContainer"`
	IsKubernetes  bool     `json:"isKubernetes"`
	EnvVars       []string `json:"envVars"`
}

SysInfo is generic holder for passsing data back

Jump to

Keyboard shortcuts

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