config

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DashboardViewGrid    = "grid"
	DashboardViewStacked = "stacked"
	DashboardViewList    = "list"
	DashboardViewTabs    = "tabs"
	DashboardViewSplit   = "split"
	DashboardViewCompare = "compare"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func ConfigPath

func ConfigPath() string

func CredentialsPath added in v0.2.0

func CredentialsPath() string
func DefaultProviderLinks() map[string]string

DefaultProviderLinks returns built-in telemetry provider-id to dashboard provider-id mappings.

func DeleteCredential added in v0.2.0

func DeleteCredential(accountID string) error

func DeleteCredentialFrom added in v0.2.0

func DeleteCredentialFrom(path, accountID string) error

func Save

func Save(cfg Config) error

func SaveAutoDetected

func SaveAutoDetected(accounts []core.AccountConfig) error

SaveAutoDetected persists auto-detected accounts into the config file (read-modify-write).

func SaveAutoDetectedTo

func SaveAutoDetectedTo(path string, accounts []core.AccountConfig) error

func SaveCredential added in v0.2.0

func SaveCredential(accountID, apiKey string) error

func SaveCredentialTo added in v0.2.0

func SaveCredentialTo(path, accountID, apiKey string) error

func SaveDashboardHideSectionsWithNoData added in v0.6.11

func SaveDashboardHideSectionsWithNoData(hide bool) error

SaveDashboardHideSectionsWithNoData persists whether empty dashboard widget sections should be hidden in the config file (read-modify-write).

func SaveDashboardHideSectionsWithNoDataTo added in v0.6.11

func SaveDashboardHideSectionsWithNoDataTo(path string, hide bool) error

func SaveDashboardProviders

func SaveDashboardProviders(providers []DashboardProviderConfig) error

SaveDashboardProviders persists dashboard provider preferences into the config file (read-modify-write).

func SaveDashboardProvidersTo

func SaveDashboardProvidersTo(path string, providers []DashboardProviderConfig) error

func SaveDashboardView added in v0.6.0

func SaveDashboardView(view string) error

SaveDashboardView persists dashboard view preference into the config file (read-modify-write).

func SaveDashboardViewTo added in v0.6.0

func SaveDashboardViewTo(path string, view string) error

func SaveDashboardWidgetSections added in v0.6.5

func SaveDashboardWidgetSections(sections []DashboardWidgetSection) error

SaveDashboardWidgetSections persists dashboard widget section preferences into the config file (read-modify-write).

func SaveDashboardWidgetSectionsTo added in v0.6.5

func SaveDashboardWidgetSectionsTo(path string, sections []DashboardWidgetSection) error

func SaveDetailWidgetSections added in v0.8.0

func SaveDetailWidgetSections(sections []DetailWidgetSection) error

SaveDetailWidgetSections persists detail view section preferences into the config file (read-modify-write).

func SaveDetailWidgetSectionsTo added in v0.8.0

func SaveDetailWidgetSectionsTo(path string, sections []DetailWidgetSection) error

func SaveIntegrationState added in v0.5.3

func SaveIntegrationState(id string, state IntegrationState) error

SaveIntegrationState persists an integration state into the config file (read-modify-write).

func SaveIntegrationStateTo added in v0.5.3

func SaveIntegrationStateTo(path string, id string, state IntegrationState) error

func SaveTheme

func SaveTheme(theme string) error

SaveTheme persists a theme name into the config file (read-modify-write).

func SaveThemeTo

func SaveThemeTo(path string, theme string) error

func SaveTimeWindow added in v0.5.2

func SaveTimeWindow(window string) error

SaveTimeWindow persists a time window into the config file (read-modify-write).

func SaveTimeWindowTo added in v0.5.2

func SaveTimeWindowTo(path string, window string) error

func SaveTo

func SaveTo(path string, cfg Config) error

Types

type Config

type Config struct {
	UI                   UIConfig                      `json:"ui"`
	Theme                string                        `json:"theme"`
	Data                 DataConfig                    `json:"data"`
	Experimental         ExperimentalConfig            `json:"experimental"`
	Telemetry            TelemetryConfig               `json:"telemetry"`
	Dashboard            DashboardConfig               `json:"dashboard"`
	ModelNormalization   core.ModelNormalizationConfig `json:"model_normalization"`
	AutoDetect           bool                          `json:"auto_detect"`
	Accounts             []core.AccountConfig          `json:"accounts"`
	AutoDetectedAccounts []core.AccountConfig          `json:"auto_detected_accounts"`
	Integrations         map[string]IntegrationState   `json:"integrations,omitempty"`
}

func DefaultConfig

func DefaultConfig() Config

func Load

func Load() (Config, error)

func LoadFrom

func LoadFrom(path string) (Config, error)

type Credentials added in v0.2.0

type Credentials struct {
	Keys map[string]string `json:"keys"` // account ID → API key
}

func LoadCredentials added in v0.2.0

func LoadCredentials() (Credentials, error)

func LoadCredentialsFrom added in v0.2.0

func LoadCredentialsFrom(path string) (Credentials, error)

type DashboardConfig

type DashboardConfig struct {
	Providers              []DashboardProviderConfig `json:"providers"`
	View                   string                    `json:"view"`
	WidgetSections         []DashboardWidgetSection  `json:"widget_sections,omitempty"`
	DetailSections         []DetailWidgetSection     `json:"detail_sections,omitempty"`
	HideSectionsWithNoData bool                      `json:"hide_sections_with_no_data,omitempty"`
}

type DashboardProviderConfig

type DashboardProviderConfig struct {
	AccountID string `json:"account_id"`
	Enabled   bool   `json:"enabled"`
}

func (*DashboardProviderConfig) UnmarshalJSON

func (p *DashboardProviderConfig) UnmarshalJSON(data []byte) error

type DashboardWidgetSection added in v0.6.5

type DashboardWidgetSection struct {
	ID      core.DashboardStandardSection `json:"id"`
	Enabled bool                          `json:"enabled"`
}

func (*DashboardWidgetSection) UnmarshalJSON added in v0.6.5

func (s *DashboardWidgetSection) UnmarshalJSON(data []byte) error

type DataConfig added in v0.5.2

type DataConfig struct {
	TimeWindow    string `json:"time_window"`    // "1d", "3d", "7d", "30d"
	RetentionDays int    `json:"retention_days"` // max days to keep in SQLite
}

type DetailWidgetSection added in v0.8.0

type DetailWidgetSection struct {
	ID      core.DetailStandardSection `json:"id"`
	Enabled bool                       `json:"enabled"`
}

func (*DetailWidgetSection) UnmarshalJSON added in v0.8.0

func (s *DetailWidgetSection) UnmarshalJSON(data []byte) error

type ExperimentalConfig

type ExperimentalConfig struct {
	Analytics bool `json:"analytics"`
}

type IntegrationState added in v0.5.3

type IntegrationState struct {
	Installed   bool   `json:"installed"`
	Version     string `json:"version,omitempty"`
	InstalledAt string `json:"installed_at,omitempty"`
	Declined    bool   `json:"declined,omitempty"`
}

type TelemetryConfig added in v0.5.0

type TelemetryConfig struct {
	// ProviderLinks maps source telemetry provider IDs to configured provider IDs.
	// Example: {"anthropic":"claude_code"}.
	ProviderLinks map[string]string `json:"provider_links"`
}

type UIConfig

type UIConfig struct {
	RefreshIntervalSeconds int     `json:"refresh_interval_seconds"`
	WarnThreshold          float64 `json:"warn_threshold"`
	CritThreshold          float64 `json:"crit_threshold"`
}

Jump to

Keyboard shortcuts

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