Documentation
¶
Index ¶
- Variables
- func MigrateAppearanceValues(values map[string]any) (map[string]any, bool)
- func MigrateTerminalValues(values map[string]any) (map[string]any, bool)
- type ServiceWrapper
- func (s *ServiceWrapper) GetBool(id string) (bool, error)
- func (s *ServiceWrapper) GetCategories() []pkgsettings.Category
- func (s *ServiceWrapper) GetCategory(id string) (pkgsettings.Category, error)
- func (s *ServiceWrapper) GetCategoryValues(id string) (map[string]any, error)
- func (s *ServiceWrapper) GetFloat(id string) (float64, error)
- func (s *ServiceWrapper) GetFloatSlice(id string) ([]float64, error)
- func (s *ServiceWrapper) GetInt(id string) (int, error)
- func (s *ServiceWrapper) GetIntSlice(id string) ([]int, error)
- func (s *ServiceWrapper) GetSetting(id string) (pkgsettings.Setting, error)
- func (s *ServiceWrapper) GetSettingValue(id string) (any, error)
- func (s *ServiceWrapper) GetString(id string) (string, error)
- func (s *ServiceWrapper) GetStringSlice(id string) ([]string, error)
- func (s *ServiceWrapper) ListSettings() pkgsettings.Store
- func (s *ServiceWrapper) LoadSettings() error
- func (s *ServiceWrapper) SetSetting(id string, value any) error
- func (s *ServiceWrapper) SetSettings(settingsMap map[string]any) error
- func (s *ServiceWrapper) ValidateSetting(id string, value any) (pkgsettings.ValidationResult, error)
- func (s *ServiceWrapper) Values() map[string]any
Constants ¶
This section is empty.
Variables ¶
var Appearance = settings.Category{ ID: "appearance", Label: "Appearance", Description: "Customize the look and feel of the application", Icon: "LuPaintbrush", Settings: map[string]settings.Setting{ // contains filtered or unexported fields }, }
var Developer = settings.Category{ ID: "developer", Label: "Developer Settings", Description: "Settings for developing or writing plugins within Omniview", Icon: "LuBeaker", Settings: map[string]settings.Setting{ "marketplace_url": { ID: "marketplace_url", Label: "Marketplace URL", Description: "Base URL for the plugin marketplace API. Change this to point to a staging or self-hosted instance.", Type: settings.Text, Default: "https://api.omniview.dev", }, "registry_public_key": { ID: "registry_public_key", Label: "Marketplace Signing Key", Description: "Hex-encoded Ed25519 public key used to verify plugin artifacts. Leave empty to use " + "the built-in key; set it when the marketplace URL points to a staging or self-hosted instance " + "that signs with its own key.", Type: settings.Text, Default: "", }, "gopath": { ID: "gopath", Label: "Go Path", Description: "Path to the Go binary", Type: settings.Text, Default: "", Validator: validateGoExecutable, FileSelection: &settings.SettingFileSelection{ Enabled: true, AllowFolders: false, Multiple: false, Extensions: nil, Relative: false, DefaultPath: "", }, }, "pnpmpath": { ID: "pnpmpath", Label: "PNPM Path", Description: "PNPM binary for standalone plugin development. Named workspaces require their owned launcher; select native pnpm with OMNIVIEW_PNPM_EXECUTABLE when starting the workspace instead.", Type: settings.Text, Default: "", FileSelection: &settings.SettingFileSelection{ Enabled: true, AllowFolders: false, Multiple: false, Extensions: nil, Relative: false, DefaultPath: "", }, }, "nodepath": { ID: "nodepath", Label: "Node Path", Description: "Path to the Node binary", Type: settings.Text, Default: "", FileSelection: &settings.SettingFileSelection{ Enabled: true, AllowFolders: false, Multiple: false, Extensions: nil, Relative: false, DefaultPath: "", }, }, }, }
var Editor = settings.Category{ ID: "editor", Label: "Editor", Description: "Change settings within the code editor", Icon: "LuCode", Settings: map[string]settings.Setting{ "folding": { ID: "folding", Type: settings.Toggle, Label: "Folding", Default: true, Description: "Enable code folding. Defaults to true.", }, "foldingHighlight": { ID: "foldingHighlight", Type: settings.Toggle, Label: "Folding Highlight", Default: true, Description: "Enable highlight for folded regions. Defaults to true.", }, "fontWeight": { ID: "fontWeight", Type: settings.Text, Label: "Font Weight", Default: defaultEditorFontWeight, Description: "The font weight.", }, "formatOnPaste": { ID: "formatOnPaste", Type: settings.Toggle, Label: "Format On Paste", Default: false, Description: "Enable format on paste. Defaults to false.", }, "formatOnType": { ID: "formatOnType", Type: settings.Toggle, Label: "Format On Type", Default: false, Description: "Enable format on type. Defaults to false.", }, "lineHeight": { ID: "lineHeight", Type: settings.Integer, Label: "Line Height", Default: 1, Description: "The line height.", }, "lineNumbers": { ID: "lineNumbers", Type: settings.Text, Options: []settings.SettingOption{ {Value: "on", Label: "On", Description: ""}, {Value: "off", Label: "Off", Description: ""}, {Value: "relative", Label: "Relative", Description: ""}, {Value: "interval", Label: "Interval", Description: ""}, }, Label: "Line Numbers", Default: "on", Description: "Control the rendering of line numbers. Defaults to 'on'.", }, "lineNumbersMinChars": { ID: "lineNumbersMinChars", Type: settings.Integer, Label: "Line Number Width", Default: defaultLineNumbersMinChars, Description: "Control the width of line numbers, by reserving horizontal space for rendering " + "at least an amount of digits. Defaults to 5.", }, "minimapEnabled": { ID: "minimapEnabled", Type: settings.Toggle, Label: "Minimap Enabled", Default: true, Description: "Enable the rendering of the minimap. Defaults to 'true'", }, "minimapScale": { ID: "minimapScale", Type: settings.Integer, Label: "Minimap Scale", Default: 1, Description: "Relative size of the font in the minimap. Defaults to 1.", }, "minimapShowSlider": { ID: "minimapShowSlider", Type: settings.Text, Label: "Minimap Slider", Options: []settings.SettingOption{ {Value: "mouseover", Label: "Mouseover", Description: ""}, {Value: "always", Label: "Always", Description: ""}, }, Default: "mouseover", Description: "Control the rendering of the minimap slider. Defaults to 'mouseover'.", }, "minimapSide": { ID: "minimapSide", Type: settings.Text, Label: "Minimap Side", Default: "right", Options: []settings.SettingOption{ {Value: "right", Label: "Right", Description: ""}, {Value: "left", Label: "Left", Description: ""}, }, Description: "Control the side of the minimap in editor. Defaults to 'right'", }, "minimapSize": { ID: "minimapSize", Type: settings.Text, Label: "Minimap Size", Default: "actual", Options: []settings.SettingOption{ {Value: "actual", Label: "Actual", Description: ""}, {Value: "proportional", Label: "Proportional", Description: ""}, {Value: "fill", Label: "Fill", Description: ""}, {Value: "fit", Label: "Fit", Description: ""}, }, Description: "Control the minimap rendering mode. Defaults to 'actual'.", }, // contains filtered or unexported fields }, }
var General = settings.Category{ ID: "general", Label: "General", Description: "General settings for the application", Icon: "LuSettings2", Settings: map[string]settings.Setting{ "language": { ID: "language", Type: settings.Text, Label: "Language", Default: "en", Description: "The language to use when displaying text", Options: []settings.SettingOption{ {Value: "en", Label: "English", Description: ""}, {Value: "es", Label: "Spanish", Description: ""}, }, }, }, }
var Telemetry = settings.Category{
ID: "telemetry",
Label: "Telemetry",
Description: "Configure observability, logging, tracing, metrics, and profiling",
Icon: "LuActivity",
Settings: buildTelemetrySettings(),
}
var Terminal = settings.Category{ ID: "terminal", Label: "Terminal", Description: "Customize the behavior of the terminal", Icon: "LuSquareTerminal", Settings: map[string]settings.Setting{ "defaultShell": { ID: "defaultShell", Type: settings.Text, Label: "Default Shell", Default: defaultShell(), Description: "The default shell to use when opening a terminal", Validator: func(value interface{}) settings.ValidationResult { val, ok := value.(string) if !ok { return settings.ValidationResult{Code: "shell_type", Message: "Enter a shell executable name or path."} } path, _, err := shellenv.Resolve([]string{val}) if err != nil { return settings.ValidationResult{Code: "shell_executable", Message: "Choose an executable shell installed on this system."} } if _, statErr := os.Stat(path); os.IsNotExist(statErr) { return settings.ValidationResult{Code: "shell_missing", Message: "The selected shell no longer exists. Choose an installed shell."} } return settings.ValidationResult{Valid: true, Code: "shell_executable", Message: "Shell executable is available."} }, }, "cursorStyle": { ID: "cursorStyle", Type: settings.Text, Label: "Cursor Style", Default: "block", Description: "The style of the cursor in the terminal", Options: []settings.SettingOption{ {Value: "block", Label: "Block", Description: ""}, {Value: "underline", Label: "Underline", Description: ""}, {Value: "bar", Label: "Bar", Description: ""}, }, }, "cursorBlink": { ID: "cursorBlink", Type: settings.Toggle, Label: "Cursor Blink", Default: true, Description: "Whether the cursor should blink in the terminal", }, // contains filtered or unexported fields }, }
Functions ¶
func MigrateAppearanceValues ¶ added in v0.5.0
MigrateAppearanceValues upgrades known legacy theme IDs without changing extension-provided or otherwise unknown IDs.
Types ¶
type ServiceWrapper ¶ added in v0.4.0
type ServiceWrapper struct {
Provider pkgsettings.Provider
CategoryMeta map[string]pkgsettings.Category // Label, Icon, Description for each category
}
ServiceWrapper exposes only frontend-safe methods of pkgsettings.Provider. Excluded: RegisterChangeHandler, RegisterSetting, RegisterSettings
(internal-only methods).
func (*ServiceWrapper) GetBool ¶ added in v0.4.0
func (s *ServiceWrapper) GetBool(id string) (bool, error)
func (*ServiceWrapper) GetCategories ¶ added in v0.4.0
func (s *ServiceWrapper) GetCategories() []pkgsettings.Category
GetCategories returns all category metadata for the UI settings navigation.
func (*ServiceWrapper) GetCategory ¶ added in v0.4.0
func (s *ServiceWrapper) GetCategory(id string) (pkgsettings.Category, error)
GetCategory returns a single settings category by ID, including full metadata (Label, Icon, Description) from the registered category definitions and live setting values from the in-memory provider.
func (*ServiceWrapper) GetCategoryValues ¶ added in v0.4.0
func (s *ServiceWrapper) GetCategoryValues(id string) (map[string]any, error)
GetCategoryValues returns a flat map of setting values for a single category.
func (*ServiceWrapper) GetFloat ¶ added in v0.4.0
func (s *ServiceWrapper) GetFloat(id string) (float64, error)
func (*ServiceWrapper) GetFloatSlice ¶ added in v0.4.0
func (s *ServiceWrapper) GetFloatSlice(id string) ([]float64, error)
func (*ServiceWrapper) GetInt ¶ added in v0.4.0
func (s *ServiceWrapper) GetInt(id string) (int, error)
func (*ServiceWrapper) GetIntSlice ¶ added in v0.4.0
func (s *ServiceWrapper) GetIntSlice(id string) ([]int, error)
func (*ServiceWrapper) GetSetting ¶ added in v0.4.0
func (s *ServiceWrapper) GetSetting(id string) (pkgsettings.Setting, error)
func (*ServiceWrapper) GetSettingValue ¶ added in v0.4.0
func (s *ServiceWrapper) GetSettingValue(id string) (any, error)
func (*ServiceWrapper) GetString ¶ added in v0.4.0
func (s *ServiceWrapper) GetString(id string) (string, error)
func (*ServiceWrapper) GetStringSlice ¶ added in v0.4.0
func (s *ServiceWrapper) GetStringSlice(id string) ([]string, error)
func (*ServiceWrapper) ListSettings ¶ added in v0.4.0
func (s *ServiceWrapper) ListSettings() pkgsettings.Store
func (*ServiceWrapper) LoadSettings ¶ added in v0.4.0
func (s *ServiceWrapper) LoadSettings() error
LoadSettings is a no-op reload trigger for the frontend. With bbolt-backed persistence, settings are always in memory — this exists so the frontend's "reload" button still has a valid binding. It re-reads from the in-memory store (which is already current).
func (*ServiceWrapper) SetSetting ¶ added in v0.4.0
func (s *ServiceWrapper) SetSetting(id string, value any) error
func (*ServiceWrapper) SetSettings ¶ added in v0.4.0
func (s *ServiceWrapper) SetSettings(settingsMap map[string]any) error
func (*ServiceWrapper) ValidateSetting ¶ added in v0.7.0
func (s *ServiceWrapper) ValidateSetting(id string, value any) (pkgsettings.ValidationResult, error)
ValidateSetting checks a draft without changing or persisting its value.
func (*ServiceWrapper) Values ¶ added in v0.4.0
func (s *ServiceWrapper) Values() map[string]any
Values returns a flat map of all setting values keyed by "category.settingID". This is a host-side convenience for the frontend — it was removed from the SDK Provider interface (plugins don't need it) but the UI settings context uses it to populate the full settings state.