rest

package
v0.0.0-...-ad0c36a Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskStat

type DiskStat struct {
	Path       string  `json:"path"`
	MountPoint string  `json:"mount_point"`
	TotalGB    float32 `json:"total_gb"`
	UsedGB     float32 `json:"used_gb"`
}

type HostNetStat

type HostNetStat struct {
	SentKB uint64 `json:"sent_kb"`
	RecvKB uint64 `json:"recv_kb"`
}

type HostResourceStats

type HostResourceStats struct {
	CpuUsagePercent uint8       `json:"cpu_used_percent"`
	MemStat         MemoryStat  `json:"memory"`
	DiskStats       []DiskStat  `json:"disks"`
	NetStat         HostNetStat `json:"network"`
}

HostResourceStats : struct to hold host resource stats

type LoginResponse

type LoginResponse struct {
	Message      string `json:"message"`
	Token        string `json:"token"`
	TotpRequired bool   `json:"totp_required"`
}

LoginResponse : struct to hold login response

type MemoryStat

type MemoryStat struct {
	TotalGB  float32 `json:"total_gb"`
	UsedGB   float32 `json:"used_gb"`
	CachedGB float32 `json:"cached_gb"`
}

type ResourceStatsData

type ResourceStatsData struct {
	SystemStat   HostResourceStats                `json:"system"`
	ServiceStats map[string]*ServiceResourceStats `json:"services"`
	TimeStamp    uint64                           `json:"timestamp"`
}

ResourceStatsData : struct to hold analytics stats data

type Server

type Server struct {
	EchoServer     *echo.Echo
	Config         *config.Config
	ServiceManager *service_manager.ServiceManager
	WorkerManager  *worker.Manager
}

Server : hold references to other components of service

func (*Server) Initialize

func (server *Server) Initialize()

Initialize : Initialize the server and its routes

func (*Server) MigrateDatabaseTables

func (server *Server) MigrateDatabaseTables()

Migrate database table

type ServiceNetStat

type ServiceNetStat struct {
	SentKB uint64 `json:"sent_kb"`
	RecvKB uint64 `json:"recv_kb"`
}

type ServiceResourceStats

type ServiceResourceStats struct {
	ServiceCpuTime uint64         `json:"service_cpu_time"`
	SystemCpuTime  uint64         `json:"system_cpu_time"`
	UsedMemoryMB   uint64         `json:"used_memory_mb"`
	NetStat        ServiceNetStat `json:"network"`
}

ServiceResourceStats : struct to hold service resource stats

Jump to

Keyboard shortcuts

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