Documentation
¶
Index ¶
- Variables
- func CoerceJSONNumbers(v interface{})
- func ConfigDir() (string, error)
- func ConfigPath() (string, error)
- func ExpandHome(path string) string
- func ParseJSONFile(path string, target any) error
- func ParseTOMLFile(path string, target any) error
- func Save(cfg Config) error
- func ValidateRawFormat(format, content string) error
- func WriteConfigAtomic(path string, format string, data interface{}) error
- func WriteJSONAtomic(path string, data interface{}) error
- func WriteRawAtomic(path string, content string) error
- func WriteTOMLAtomic(path string, data interface{}) error
- func WriteYAMLAtomic(path string, data interface{}) error
- type Config
- type DashboardConfig
- type DiscoveryConfig
- type HiddenStore
- type ManualAgent
- type TokenStore
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Functions ¶
func CoerceJSONNumbers ¶
func CoerceJSONNumbers(v interface{})
CoerceJSONNumbers recursively walks a value decoded from JSON and converts float64 values that are whole numbers (e.g., 42617.0) to int64 (42617). This prevents the TOML encoder from writing "port = 42617.0" when the original config had "port = 42617".
func ConfigPath ¶
func ExpandHome ¶
ExpandHome replaces a leading ~ with the user's home directory.
func ParseJSONFile ¶
ParseJSONFile reads and unmarshals a JSON file into the given target.
func ParseTOMLFile ¶
ParseTOMLFile reads and unmarshals a TOML file into the given target.
func ValidateRawFormat ¶
ValidateRawFormat checks that a raw config string is syntactically valid for the given format (toml, json, yaml). Returns nil on success.
func WriteConfigAtomic ¶
WriteConfigAtomic writes config file atomically based on format
func WriteJSONAtomic ¶
WriteJSONAtomic writes JSON config atomically using temp file + rename
func WriteRawAtomic ¶
WriteRawAtomic writes a raw string to a file atomically. Used when the config is already in its target format (e.g., raw TOML text from the editor) and should be preserved as-is without re-encoding.
func WriteTOMLAtomic ¶
WriteTOMLAtomic writes TOML config atomically using temp file + rename
func WriteYAMLAtomic ¶
WriteYAMLAtomic writes YAML config atomically using temp file + rename
Types ¶
type Config ¶
type Config struct {
Dashboard DashboardConfig `toml:"dashboard"`
Discovery DiscoveryConfig `toml:"discovery"`
Agents []ManualAgent `toml:"agents"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type DashboardConfig ¶
type DiscoveryConfig ¶
type HiddenStore ¶
type HiddenStore struct {
// contains filtered or unexported fields
}
HiddenStore persists hidden session keys per agent. Stored in ~/.eyrie/hidden_sessions.json with mode 0600.
func NewHiddenStore ¶
func NewHiddenStore() (*HiddenStore, error)
func (*HiddenStore) Hide ¶
func (hs *HiddenStore) Hide(agentName, sessionKey string) error
func (*HiddenStore) IsHidden ¶
func (hs *HiddenStore) IsHidden(agentName, sessionKey string) bool
func (*HiddenStore) Unhide ¶
func (hs *HiddenStore) Unhide(agentName, sessionKey string) error
type ManualAgent ¶
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore persists bearer tokens keyed by agent name. Tokens are stored in ~/.eyrie/tokens.json with mode 0600.
func NewTokenStore ¶
func NewTokenStore() (*TokenStore, error)
func (*TokenStore) Get ¶
func (ts *TokenStore) Get(agentName string) string
func (*TokenStore) Set ¶
func (ts *TokenStore) Set(agentName, token string) error