Documentation
¶
Overview ¶
Package config provides persistent configuration for the Agent.
Index ¶
- type AuthorizedHub
- type Config
- type Manager
- func (m *Manager) AddAuthorizedHub(hub AuthorizedHub) error
- func (m *Manager) GetAuthorizedHubs() []AuthorizedHub
- func (m *Manager) GetConfig() Config
- func (m *Manager) GetConsoleLogEnabled() bool
- func (m *Manager) GetInstallPath() string
- func (m *Manager) GetName() string
- func (m *Manager) GetTelemetryEnabled() bool
- func (m *Manager) GetTelemetryInterval() int
- func (m *Manager) RemoveAuthorizedHub(hubID string) error
- func (m *Manager) Save() error
- func (m *Manager) SetConsoleLogEnabled(enabled bool) error
- func (m *Manager) SetInstallPath(path string) error
- func (m *Manager) SetName(name string) error
- func (m *Manager) SetTelemetryEnabled(enabled bool) error
- func (m *Manager) SetTelemetryInterval(seconds int) error
- func (m *Manager) UpdateHubLastSeen(hubID string, lastSeen time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizedHub ¶
type AuthorizedHub struct {
ID string `json:"id"`
Name string `json:"name"`
Platform string `json:"platform,omitempty"`
Token string `json:"token"`
PairedAt time.Time `json:"pairedAt"`
LastSeen time.Time `json:"lastSeen"`
}
AuthorizedHub represents a Hub that has been paired with this Agent.
type Config ¶
type Config struct {
Name string `json:"name"`
InstallPath string `json:"installPath"`
TelemetryEnabled bool `json:"telemetryEnabled"`
TelemetryInterval int `json:"telemetryInterval"`
ConsoleLogEnabled bool `json:"consoleLogEnabled"`
AuthorizedHubs []AuthorizedHub `json:"authorizedHubs,omitempty"`
}
Config holds the agent configuration.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles loading and saving configuration.
func NewManager ¶
NewManager creates a new configuration manager.
func (*Manager) AddAuthorizedHub ¶
func (m *Manager) AddAuthorizedHub(hub AuthorizedHub) error
AddAuthorizedHub adds a Hub to the authorized list.
func (*Manager) GetAuthorizedHubs ¶
func (m *Manager) GetAuthorizedHubs() []AuthorizedHub
GetAuthorizedHubs returns the list of authorized Hubs.
func (*Manager) GetConsoleLogEnabled ¶ added in v0.6.0
GetConsoleLogEnabled returns whether console log streaming is enabled.
func (*Manager) GetInstallPath ¶
GetInstallPath returns the install path.
func (*Manager) GetTelemetryEnabled ¶ added in v0.6.0
GetTelemetryEnabled returns whether telemetry is enabled.
func (*Manager) GetTelemetryInterval ¶ added in v0.6.0
GetTelemetryInterval returns the telemetry interval in seconds (1-10, default 2).
func (*Manager) RemoveAuthorizedHub ¶
RemoveAuthorizedHub removes a Hub from the authorized list.
func (*Manager) SetConsoleLogEnabled ¶ added in v0.6.0
SetConsoleLogEnabled sets the console log enabled state and saves config.
func (*Manager) SetInstallPath ¶
SetInstallPath sets the install path and saves config.
func (*Manager) SetTelemetryEnabled ¶ added in v0.6.0
SetTelemetryEnabled sets the telemetry enabled state and saves config.
func (*Manager) SetTelemetryInterval ¶ added in v0.6.0
SetTelemetryInterval sets the telemetry interval in seconds and saves config.