Documentation
¶
Index ¶
- Constants
- func RedactSettingValues(values map[string]any, schema map[string]pkgsettings.Setting) map[string]any
- func RedactSettingsSchema(schema map[string]pkgsettings.Setting) map[string]pkgsettings.Setting
- func RedactedPluginSettings(ctrl Controller, plugin string) map[string]pkgsettings.Setting
- type AdapterV1
- func (a *AdapterV1) GetSetting(id string) (pkgsettings.Setting, error)
- func (a *AdapterV1) GetSettingValue(id string) (any, error)
- func (a *AdapterV1) ListSettings() map[string]pkgsettings.Setting
- func (a *AdapterV1) SetSetting(id string, value any) error
- func (a *AdapterV1) SetSettings(settings map[string]any) error
- type Controller
- type Provider
- type Service
- type ServiceWrapper
- func (s *ServiceWrapper) GetSetting(plugin, id string) (pkgsettings.Setting, error)
- func (s *ServiceWrapper) HasPlugin(pluginID string) bool
- func (s *ServiceWrapper) ListPlugins() ([]string, error)
- func (s *ServiceWrapper) ListSettings(plugin string) map[string]pkgsettings.Setting
- func (s *ServiceWrapper) PluginValues(plugin string) map[string]any
- func (s *ServiceWrapper) ServiceShutdown() error
- func (s *ServiceWrapper) ServiceStartup(ctx context.Context, options application.ServiceOptions) error
- func (s *ServiceWrapper) SetSetting(plugin, id string, value any) error
- func (s *ServiceWrapper) SetSettings(plugin string, settingsMap map[string]any) error
- func (s *ServiceWrapper) Values() map[string]any
Constants ¶
const (
PluginName = "settings"
)
Variables ¶
This section is empty.
Functions ¶
func RedactSettingValues ¶ added in v0.5.0
func RedactSettingValues(values map[string]any, schema map[string]pkgsettings.Setting) map[string]any
RedactSettingValues projects provider values for control/inspect output. A value is public only when its schema explicitly identifies it as nonsecret. Unknown or unavailable plugin schemas therefore fail closed. Provider-owned maps and values are not modified; the projection is for read-only encoding.
func RedactSettingsSchema ¶ added in v0.5.0
func RedactSettingsSchema(schema map[string]pkgsettings.Setting) map[string]pkgsettings.Setting
RedactSettingsSchema keeps schema metadata while excluding every value-bearing field of sensitive settings. Do not serialize an unredacted schema alongside RedactSettingValues: defaults and select options can also contain credentials.
func RedactedPluginSettings ¶ added in v0.5.0
func RedactedPluginSettings(ctrl Controller, plugin string) map[string]pkgsettings.Setting
RedactedPluginSettings is the control boundary's safe plugin inspection API. Only hydrated schema metadata can classify values, never inferred fallback metadata. The SDK v1 decoder treats absent legacy classification as sensitive; Password is always secret. Unavailable or foreign schema origins fail closed.
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 (*AdapterV1) ListSettings ¶ added in v0.2.0
func (a *AdapterV1) ListSettings() map[string]pkgsettings.Setting
func (*AdapterV1) SetSetting ¶ added in v0.2.0
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