system

package
v0.4.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicIP added in v0.1.5

func GetPublicIP(version string) (string, error)

Types

type CPUStats added in v0.1.5

type CPUStats struct {
	UsagePercent float64 `json:"usage_percent"`
	Cores        int     `json:"cores"`
}

type DNSHealth added in v0.1.5

type DNSHealth struct {
	Healthy   bool            `json:"healthy"`
	Resolvers []ResolverCheck `json:"resolvers"`
}

type DiskStats added in v0.1.5

type DiskStats struct {
	Total        uint64  `json:"total"`
	Used         uint64  `json:"used"`
	Free         uint64  `json:"free"`
	UsagePercent float64 `json:"usage_percent"`
	MountPoint   string  `json:"mount_point"`
}

type LoadAverage added in v0.1.5

type LoadAverage struct {
	Load1  float64 `json:"load1"`
	Load5  float64 `json:"load5"`
	Load15 float64 `json:"load15"`
}

type MemoryStats added in v0.1.5

type MemoryStats struct {
	Total        uint64  `json:"total"`
	Used         uint64  `json:"used"`
	Free         uint64  `json:"free"`
	Available    uint64  `json:"available"`
	UsagePercent float64 `json:"usage_percent"`
}

type NetworkHealth added in v0.1.5

type NetworkHealth struct {
	ExternalAccess bool               `json:"external_access"`
	DNS            DNSHealth          `json:"dns"`
	Interfaces     []NetworkInterface `json:"interfaces"`
	CheckedAt      time.Time          `json:"checked_at"`
}

func CheckNetworkHealth added in v0.1.5

func CheckNetworkHealth(ctx context.Context) (*NetworkHealth, error)

type NetworkInterface added in v0.1.5

type NetworkInterface struct {
	Name      string   `json:"name"`
	Addresses []string `json:"addresses"`
	Flags     string   `json:"flags"`
}

type ResolverCheck added in v0.1.5

type ResolverCheck struct {
	Server  string `json:"server"`
	Healthy bool   `json:"healthy"`
	Latency int64  `json:"latency_ms"`
	Error   string `json:"error,omitempty"`
}

type ServerInfo added in v0.1.5

type ServerInfo struct {
	Hostname   string             `json:"hostname"`
	PublicIPv4 string             `json:"public_ipv4"`
	PublicIPv6 string             `json:"public_ipv6"`
	Interfaces []NetworkInterface `json:"interfaces"`
}

func GetServerInfo added in v0.1.5

func GetServerInfo() (*ServerInfo, error)

type Service

type Service struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Load        string `json:"load"`
	Active      string `json:"active"`
	Sub         string `json:"sub"`
}

type ServicesManager

type ServicesManager struct{}

func NewServicesManager

func NewServicesManager() *ServicesManager

func (*ServicesManager) DisableService

func (m *ServicesManager) DisableService(name string) error

func (*ServicesManager) EnableService

func (m *ServicesManager) EnableService(name string) error

func (*ServicesManager) GetService

func (m *ServicesManager) GetService(name string) (*Service, error)

func (*ServicesManager) ListServices

func (m *ServicesManager) ListServices() ([]Service, error)

func (*ServicesManager) RestartService

func (m *ServicesManager) RestartService(name string) error

func (*ServicesManager) StartService

func (m *ServicesManager) StartService(name string) error

func (*ServicesManager) StopService

func (m *ServicesManager) StopService(name string) error

type SystemStats added in v0.1.5

type SystemStats struct {
	CPU     CPUStats    `json:"cpu"`
	Memory  MemoryStats `json:"memory"`
	Disk    DiskStats   `json:"disk"`
	Uptime  int64       `json:"uptime"`
	LoadAvg LoadAverage `json:"load_avg"`
}

func GetSystemStats added in v0.1.5

func GetSystemStats() (*SystemStats, error)

Jump to

Keyboard shortcuts

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