Documentation
¶
Overview ¶
Package settings manages global and per-key plugin settings.
Index ¶
- Constants
- Variables
- func InvertFillEnabled() bool
- func ResolveRefreshMs(ks KeySettings) int64
- func Set(gs GlobalSettings)
- func ShowGlyphsEnabled() bool
- func SkipUpdateCheckEnabled() bool
- type ClaudeProviderSettings
- type GlobalSettings
- type KeySettings
- type ProviderSettingsMap
- type ProviderSource
- type TextSize
Constants ¶
const DefaultRefreshMinutes = 15
Variables ¶
var RefreshPresets = []int{5, 10, 15, 30, 60}
RefreshPresets are the allowed refresh intervals in minutes.
Functions ¶
func InvertFillEnabled ¶
func InvertFillEnabled() bool
InvertFillEnabled returns the global invert-fill toggle.
func ResolveRefreshMs ¶
func ResolveRefreshMs(ks KeySettings) int64
ResolveRefreshMs returns the effective refresh interval in ms for a key.
func ShowGlyphsEnabled ¶
func ShowGlyphsEnabled() bool
ShowGlyphsEnabled returns the global show-glyphs toggle.
func SkipUpdateCheckEnabled ¶
func SkipUpdateCheckEnabled() bool
SkipUpdateCheckEnabled returns the skip-update-check toggle.
Types ¶
type ClaudeProviderSettings ¶
type ClaudeProviderSettings struct {
Source ProviderSource `json:"source,omitempty"`
}
ClaudeProviderSettings holds Claude-specific auth config. After the browser-extension pivot the only meaningful setting is Source — which auth paths to exercise for Claude. Cookie paste is gone; the "browser" path now runs through the Usage Buttons Helper extension.
func ClaudeSettings ¶
func ClaudeSettings() ClaudeProviderSettings
ClaudeSettings returns Claude provider settings with defaults.
type GlobalSettings ¶
type GlobalSettings struct {
DefaultRefreshMinutes *int `json:"defaultRefreshMinutes,omitempty"`
DefaultValueSize TextSize `json:"defaultValueSize,omitempty"`
DefaultSubvalueSize TextSize `json:"defaultSubvalueSize,omitempty"`
InvertFill bool `json:"invertFill,omitempty"`
ShowGlyphs *bool `json:"showGlyphs,omitempty"`
SkipUpdateCheck bool `json:"skipUpdateCheck,omitempty"`
Providers *ProviderSettingsMap `json:"providers,omitempty"`
}
GlobalSettings are shared across every key and persisted by Stream Deck (survive plugin rebuilds, ride with user profiles).
type KeySettings ¶
type KeySettings struct {
// Provider is now derived from action UUID; this field is
// kept for backwards compat but ignored.
ProviderID string `json:"providerId,omitempty"`
MetricID string `json:"metricId,omitempty"`
RefreshMinutes *int `json:"refreshMinutes,omitempty"`
WarnBelow *float64 `json:"warnBelow,omitempty"`
CriticalBelow *float64 `json:"criticalBelow,omitempty"`
WarnColor string `json:"warnColor,omitempty"`
CriticalColor string `json:"criticalColor,omitempty"`
LabelOverride string `json:"labelOverride,omitempty"`
HideLabel bool `json:"hideLabel,omitempty"`
CaptionOverride string `json:"captionOverride,omitempty"`
FillColor string `json:"fillColor,omitempty"`
BgColor string `json:"bgColor,omitempty"`
TextColor string `json:"textColor,omitempty"`
FillDirection string `json:"fillDirection,omitempty"`
ValueSize TextSize `json:"valueSize,omitempty"`
SubvalueSize TextSize `json:"subvalueSize,omitempty"`
ShowBorder *bool `json:"showBorder,omitempty"`
ShowGlyph *bool `json:"showGlyph,omitempty"`
ShowResetTimer *bool `json:"showResetTimer,omitempty"`
ShowRawCounts *bool `json:"showRawCounts,omitempty"`
}
KeySettings are per-button settings stored by Stream Deck.
type ProviderSettingsMap ¶
type ProviderSettingsMap struct {
Claude *ClaudeProviderSettings `json:"claude,omitempty"`
}
ProviderSettingsMap holds per-provider config.
type ProviderSource ¶
type ProviderSource string
const ( SourceOAuth ProviderSource = "oauth" SourceCookie ProviderSource = "cookie" SourceBoth ProviderSource = "both" )
type TextSize ¶
type TextSize string
func DefaultSubvalueSz ¶
func DefaultSubvalueSz() TextSize
DefaultSubvalueSz returns the global default subvalue text size.
func DefaultValueSz ¶
func DefaultValueSz() TextSize
DefaultValueSz returns the global default value text size.