settings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginName = "settings"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterV1 added in v0.2.0

type AdapterV1 struct {
	// contains filtered or unexported fields
}

AdapterV1 wraps SDK v1 settings.Provider as the engine canonical SettingsProvider. For v1, all methods are direct delegation (types identical). When v2 ships and canonical types diverge, AdapterV1 translates v1 → canonical.

func NewAdapterV1 added in v0.2.0

func NewAdapterV1(inner sdksettings.Provider) *AdapterV1

NewAdapterV1 creates a new v1 adapter wrapping the given SDK settings provider.

func (*AdapterV1) GetSetting added in v0.2.0

func (a *AdapterV1) GetSetting(id string) (pkgsettings.Setting, error)

func (*AdapterV1) GetSettingValue added in v0.2.0

func (a *AdapterV1) GetSettingValue(id string) (any, error)

func (*AdapterV1) ListSettings added in v0.2.0

func (a *AdapterV1) ListSettings() map[string]pkgsettings.Setting

func (*AdapterV1) SetSetting added in v0.2.0

func (a *AdapterV1) SetSetting(id string, value any) error

func (*AdapterV1) SetSettings added in v0.2.0

func (a *AdapterV1) SetSettings(settings map[string]any) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

TODO - I really do not like this. I wish we could just expose the interface to the IDE instead of having to manually embed the same controller into a struct and declare pointer recievers for each method.

Currently a limitation of Wails it seems, unless I'm missing something.

func NewClient

func NewClient(controller Controller) *Client

func (*Client) GetSetting

func (c *Client) GetSetting(plugin, id string) (pkgsettings.Setting, error)

func (*Client) ListPlugins

func (c *Client) ListPlugins() ([]string, error)

func (*Client) ListSettings

func (c *Client) ListSettings(plugin string) map[string]pkgsettings.Setting

func (*Client) PluginValues

func (c *Client) PluginValues(plugin string) map[string]any

func (*Client) SetSetting

func (c *Client) SetSetting(plugin, id string, value any) error

func (*Client) SetSettings

func (c *Client) SetSettings(plugin string, settings map[string]any) error

func (*Client) Values

func (c *Client) Values() map[string]any

type Controller

type Controller interface {
	internaltypes.Controller
	Service
}

Controller handles all requests to interface with the settings capabilities on installed plugins.

This controller is embedded in the client IDE facing client.

func NewController

func NewController(logger logging.Logger, sp pkgsettings.Provider) Controller

NewController returns a new Controller instance.

type Service added in v0.2.0

type Service interface {
	// ListPlugins returns a list of all the plugins that are registered with the settings controller
	ListPlugins() ([]string, error)

	// Values returns a list of all of the values calculated in the current setting store
	Values() map[string]any

	// PluginValues returns a list of all of the values calculated in the plugin's setting store
	PluginValues(plugin string) map[string]any

	// ListSettings returns the settings store
	ListSettings(plugin string) map[string]pkgsettings.Setting

	// GetSetting returns the setting by ID. This ID should be in the form of a dot separated string
	// that represents the path to the setting. For example, "appearance.theme"
	GetSetting(plugin, id string) (pkgsettings.Setting, error)

	// SetSetting sets the value of the setting by ID
	SetSetting(plugin, id string, value any) error

	// SetSettings sets multiple settings at once
	SetSettings(plugin string, settings map[string]any) error
}

Service is the system/UI facing client for making settings requests to the settings controller.

type SettingsProvider added in v0.2.0

type SettingsProvider interface {
	ListSettings() map[string]pkgsettings.Setting
	GetSetting(id string) (pkgsettings.Setting, error)
	GetSettingValue(id string) (any, error)
	SetSetting(id string, value any) error
	SetSettings(settings map[string]any) error
}

SettingsProvider is the engine's version-independent interface for settings plugins. For v1, method signatures match SDK settings.Provider exactly (doc 20 §13.7). When v2 redesigns settings (adds context.Context), this diverges.

Jump to

Keyboard shortcuts

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