config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 Imported by: 0

Documentation

Overview

Package config provides persistent configuration for the Agent.

Index

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

func NewManager() (*Manager, error)

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) GetConfig

func (m *Manager) GetConfig() Config

GetConfig returns a copy of the current config.

func (*Manager) GetConsoleLogEnabled added in v0.6.0

func (m *Manager) GetConsoleLogEnabled() bool

GetConsoleLogEnabled returns whether console log streaming is enabled.

func (*Manager) GetInstallPath

func (m *Manager) GetInstallPath() string

GetInstallPath returns the install path.

func (*Manager) GetName

func (m *Manager) GetName() string

GetName returns the agent name.

func (*Manager) GetTelemetryEnabled added in v0.6.0

func (m *Manager) GetTelemetryEnabled() bool

GetTelemetryEnabled returns whether telemetry is enabled.

func (*Manager) GetTelemetryInterval added in v0.6.0

func (m *Manager) GetTelemetryInterval() int

GetTelemetryInterval returns the telemetry interval in seconds (1-10, default 2).

func (*Manager) RemoveAuthorizedHub

func (m *Manager) RemoveAuthorizedHub(hubID string) error

RemoveAuthorizedHub removes a Hub from the authorized list.

func (*Manager) Save

func (m *Manager) Save() error

Save writes config to disk.

func (*Manager) SetConsoleLogEnabled added in v0.6.0

func (m *Manager) SetConsoleLogEnabled(enabled bool) error

SetConsoleLogEnabled sets the console log enabled state and saves config.

func (*Manager) SetInstallPath

func (m *Manager) SetInstallPath(path string) error

SetInstallPath sets the install path and saves config.

func (*Manager) SetName

func (m *Manager) SetName(name string) error

SetName sets the agent name and saves config.

func (*Manager) SetTelemetryEnabled added in v0.6.0

func (m *Manager) SetTelemetryEnabled(enabled bool) error

SetTelemetryEnabled sets the telemetry enabled state and saves config.

func (*Manager) SetTelemetryInterval added in v0.6.0

func (m *Manager) SetTelemetryInterval(seconds int) error

SetTelemetryInterval sets the telemetry interval in seconds and saves config.

func (*Manager) UpdateHubLastSeen

func (m *Manager) UpdateHubLastSeen(hubID string, lastSeen time.Time) error

UpdateHubLastSeen updates the LastSeen timestamp for a Hub.

Jump to

Keyboard shortcuts

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