settings

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: AGPL-3.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Provider. 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 Controller

type Controller interface {
	internaltypes.Controller
	ServiceStartup(ctx context.Context, options application.ServiceOptions) error
	ServiceShutdown() error
	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, store *settingsstore.Store) Controller

NewController returns a new Controller instance.

type Provider added in v0.4.0

type Provider 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
}

Provider 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.

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 interface for making settings requests.

type ServiceWrapper added in v0.4.0

type ServiceWrapper struct {
	Ctrl Controller
}

ServiceWrapper is an explicit delegation wrapper around settings.Controller. Excluded: OnPluginInit, OnPluginStart, OnPluginStop, OnPluginShutdown,

OnPluginDestroy

func (*ServiceWrapper) GetSetting added in v0.4.0

func (s *ServiceWrapper) GetSetting(plugin, id string) (pkgsettings.Setting, error)

func (*ServiceWrapper) HasPlugin added in v0.4.0

func (s *ServiceWrapper) HasPlugin(pluginID string) bool

func (*ServiceWrapper) ListPlugins added in v0.4.0

func (s *ServiceWrapper) ListPlugins() ([]string, error)

func (*ServiceWrapper) ListSettings added in v0.4.0

func (s *ServiceWrapper) ListSettings(plugin string) map[string]pkgsettings.Setting

func (*ServiceWrapper) PluginValues added in v0.4.0

func (s *ServiceWrapper) PluginValues(plugin string) map[string]any

func (*ServiceWrapper) ServiceShutdown added in v0.4.0

func (s *ServiceWrapper) ServiceShutdown() error

func (*ServiceWrapper) ServiceStartup added in v0.4.0

func (s *ServiceWrapper) ServiceStartup(ctx context.Context, options application.ServiceOptions) error

func (*ServiceWrapper) SetSetting added in v0.4.0

func (s *ServiceWrapper) SetSetting(plugin, id string, value any) error

func (*ServiceWrapper) SetSettings added in v0.4.0

func (s *ServiceWrapper) SetSettings(plugin string, settingsMap map[string]any) error

func (*ServiceWrapper) Values added in v0.4.0

func (s *ServiceWrapper) Values() map[string]any

Jump to

Keyboard shortcuts

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