Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) GetSetting(plugin, id string) (pkgsettings.Setting, error)
- func (c *Client) ListPlugins() ([]string, error)
- func (c *Client) ListSettings(plugin string) map[string]pkgsettings.Setting
- func (c *Client) PluginValues(plugin string) map[string]any
- func (c *Client) SetSetting(plugin, id string, value any) error
- func (c *Client) SetSettings(plugin string, settings map[string]any) error
- func (c *Client) Values() map[string]any
- type Controller
- type IClient
Constants ¶
View Source
const (
PluginName = "settings"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 (*Client) ListSettings ¶
func (c *Client) ListSettings(plugin string) map[string]pkgsettings.Setting
func (*Client) SetSettings ¶
type Controller ¶
type Controller interface {
internaltypes.Controller
IClient
}
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 *zap.SugaredLogger, sp pkgsettings.Provider) Controller
NewController returns a new Controller instance.
type IClient ¶
type IClient 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
}
IClient is the system/UI facing client for making settings requests to the settings controller.
Click to show internal directories.
Click to hide internal directories.