Documentation ¶
Index ¶
- Constants
- Variables
- func GetCPUInfo() ([]cpu.InfoStat, error)
- func GetCPULoad() (*structures.CPULoad, error)
- func GetCPUTimes() ([]cpu.TimesStat, error)
- func GetDiskIO() ([]io.Stats, error)
- func GetDiskInfo(path string) (*structures.UsageStat, error)
- func GetDiskPartitions() ([]structures.PartitionStat, error)
- func GetVirtualMemory() (*structures.Memory, error)
- type PanelSettings
- func (p *PanelSettings) GetAddr() string
- func (p *PanelSettings) GetDashboardUpdateTimeout() time.Duration
- func (p *PanelSettings) GetLanguage() string
- func (p *PanelSettings) GetLogLevel() string
- func (p *PanelSettings) GetPort() string
- func (p *PanelSettings) GetSettings() (*PanelSettings, error)
- func (p *PanelSettings) ResetSettings() error
- func (p *PanelSettings) String() string
- func (p *PanelSettings) UpdateSettings(settings PanelSettings) error
Constants ¶
View Source
const ( PanelVersion = "0.0.1" DefaultLanguage = "en" DefaultLogLevel = logrus.DebugLevel DefaultAddr = "0.0.0.0" DefaultPort = "7777" DefaultDashboardUpdateTimeout = time.Second * 1 )
Variables ¶
View Source
var ( DefaultConfigPath = os.Getenv("HOME") + "/.config/control-panel/" DefaultSettingsFile = "settings" )
Functions ¶
func GetCPUTimes ¶
GetCPUTimes GetCpuTimes returns cpu times
func GetDiskInfo ¶
func GetDiskInfo(path string) (*structures.UsageStat, error)
GetDiskInfo returns disk info
func GetDiskPartitions ¶
func GetDiskPartitions() ([]structures.PartitionStat, error)
GetDiskPartitions returns disk partitions
func GetVirtualMemory ¶
func GetVirtualMemory() (*structures.Memory, error)
GetVirtualMemory returns virtual memory info
Types ¶
type PanelSettings ¶
type PanelSettings struct { Addr string `json:"addr"` Port string `json:"port"` LogLevel logrus.Level `json:"log_level"` Language string `json:"language"` DashboardUpdateTimeout time.Duration `json:"dashboard_update_timeout"` // contains filtered or unexported fields }
PanelSettings port - the port on which the panel will work logLevel - the debug level of the panel language - panel language DashboardUpdateTimeout - the timeout of updates dashboard
func DefaultPanelSettings ¶
func DefaultPanelSettings() *PanelSettings
DefaultPanelSettings ErrorLevels: panic fatal error warning info debug trace
func NewPanelSettings ¶
func NewPanelSettings(settingsPath string) (*PanelSettings, error)
func (*PanelSettings) GetAddr ¶
func (p *PanelSettings) GetAddr() string
func (*PanelSettings) GetDashboardUpdateTimeout ¶
func (p *PanelSettings) GetDashboardUpdateTimeout() time.Duration
func (*PanelSettings) GetLanguage ¶
func (p *PanelSettings) GetLanguage() string
func (*PanelSettings) GetLogLevel ¶
func (p *PanelSettings) GetLogLevel() string
func (*PanelSettings) GetPort ¶
func (p *PanelSettings) GetPort() string
func (*PanelSettings) GetSettings ¶
func (p *PanelSettings) GetSettings() (*PanelSettings, error)
GetSettings returns the settings if the settings are not found, it will save and return default settings
func (*PanelSettings) ResetSettings ¶
func (p *PanelSettings) ResetSettings() error
func (*PanelSettings) String ¶
func (p *PanelSettings) String() string
String returns config as string
func (*PanelSettings) UpdateSettings ¶
func (p *PanelSettings) UpdateSettings(settings PanelSettings) error
UpdateSettings updates the settings
Click to show internal directories.
Click to hide internal directories.