Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTelemetryExplicitlySet ¶ added in v0.5.0
func IsTelemetryExplicitlySet() bool
IsTelemetryExplicitlySet returns true if telemetry.enabled is explicitly set in config or environment.
func UpdateTelemetrySettings ¶ added in v0.5.0
UpdateTelemetrySettings updates the telemetry configuration in the config file. Uses yaml.Node to preserve comments and formatting.
func UpdateTelemetrySettingsWithOptions ¶ added in v0.5.0
func UpdateTelemetrySettingsWithOptions(enabled bool, opts UpdateOptions) error
UpdateTelemetrySettingsWithOptions is the testable version of UpdateTelemetrySettings
Types ¶
type Config ¶
type Config struct {
// OneKeyMap is the path to the main onekeymap configuration file.
OneKeyMap string `mapstructure:"onekeymap"`
// Telemetry holds OpenTelemetry configuration.
Telemetry TelemetryConfig `mapstructure:"telemetry"`
// ServerListen is the server listen address (e.g., "tcp://127.0.0.1:50051" or "unix:///tmp/onekeymap.sock").
ServerListen string `mapstructure:"server.listen"`
// Editors holds configuration for different editors.
Editors map[string]EditorConfig `mapstructure:"editors"`
}
type EditorConfig ¶
type EditorConfig struct {
// KeymapPath is the path to the editor's keymap file.
KeymapPath string `mapstructure:"keymap_path"`
// TODO(xinnjie): Sync command is not implement yet
// SyncEnabled specifies whether keymap syncing is enabled for this editor.
SyncEnabled bool `mapstructure:"sync_enabled"`
}
EditorConfig holds per-editor configuration settings.
type TelemetryConfig ¶ added in v0.5.0
type TelemetryConfig struct {
// Enabled controls whether telemetry is enabled (default: false).
// When this field is explicitly set in config (true or false), no prompt will be shown.
// When not set, a prompt will be displayed to ask user's preference.
Enabled bool `mapstructure:"enabled"`
// Endpoint is the OTLP exporter endpoint (host:port, without http:// or https://).
// Example: "otlp-gateway-prod-us-central-0.grafana.net:443"
Endpoint string `mapstructure:"endpoint"`
// Headers are custom headers for OTLP exporter (e.g., for authentication).
// Format: "key1=value1,key2=value2"
Headers string `mapstructure:"headers"`
}
TelemetryConfig holds OpenTelemetry configuration.
Click to show internal directories.
Click to hide internal directories.