Documentation
¶
Overview ¶
Package config manages configuration parameters. It manages the configuration for the Windows Agent so that only a single config file needs to exist.
Index ¶
- type Config
- func (c *Config) LandscapeAgentUID() (string, error)
- func (c *Config) LandscapeClientConfig() (string, Source, error)
- func (c *Config) SetLandscapeAgentUID(ctx context.Context, uid string) error
- func (c *Config) SetLandscapeNotifier(notify LandscapeNotifier)
- func (c *Config) SetStoreSubscription(ctx context.Context, proToken string) (err error)
- func (c *Config) SetUbuntuProNotifier(notify UbuntuProNotifier)
- func (c *Config) SetUserLandscapeConfig(ctx context.Context, landscapeConfig string) error
- func (c *Config) SetUserSubscription(ctx context.Context, proToken string) (err error)
- func (c *Config) Subscription() (token string, source Source, err error)
- func (c *Config) UpdateRegistryData(ctx context.Context, data RegistryData, db *database.DistroDB) (err error)
- type LandscapeNotifier
- type RegistryData
- type Source
- type UbuntuProNotifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config manages configuration parameters. It is a wrapper around a dictionary that reads and updates the config file.
func (*Config) LandscapeAgentUID ¶
LandscapeAgentUID returns the UID assigned to this agent by the Landscape server. An empty string is returned if no UID has been assigned.
func (*Config) LandscapeClientConfig ¶
LandscapeClientConfig returns the complete Landscape client configuration and the method it was acquired with (if any).
func (*Config) SetLandscapeAgentUID ¶
SetLandscapeAgentUID overrides the Landscape agent UID and notify listeners.
func (*Config) SetLandscapeNotifier ¶
func (c *Config) SetLandscapeNotifier(notify LandscapeNotifier)
SetLandscapeNotifier sets the function to be called when the Landscape configuration changes.
func (*Config) SetStoreSubscription ¶
SetStoreSubscription overwrites the value of the store-provided Ubuntu Pro token.
func (*Config) SetUbuntuProNotifier ¶
func (c *Config) SetUbuntuProNotifier(notify UbuntuProNotifier)
SetUbuntuProNotifier sets the function to be called when the Ubuntu Pro subscription changes.
func (*Config) SetUserLandscapeConfig ¶
SetUserLandscapeConfig overwrites the value of the user-provided Landscape configuration.
func (*Config) SetUserSubscription ¶
SetUserSubscription overwrites the value of the user-provided Ubuntu Pro token.
func (*Config) Subscription ¶
Subscription returns the ProToken and the method it was acquired with (if any).
func (*Config) UpdateRegistryData ¶
func (c *Config) UpdateRegistryData(ctx context.Context, data RegistryData, db *database.DistroDB) (err error)
UpdateRegistryData takes in data from the registry and applies it as necessary.
type LandscapeNotifier ¶
LandscapeNotifier is a function that is called when the Landscape configuration changes.
type RegistryData ¶
type RegistryData struct {
UbuntuProToken, LandscapeConfig string
}
RegistryData contains the data that the Ubuntu Pro registry key can provide.
type Source ¶
type Source int
Source indicates the method a configuration parameter was acquired.
const ( // SourceNone -> no data. SourceNone Source = iota // SourceUser -> the data was introduced by the user. SourceUser // SourceMicrosoftStore -> the data was acquired via the Microsoft Store. SourceMicrosoftStore // SourceRegistry -> the data was obtained from the registry. SourceRegistry )
config Source types.
type UbuntuProNotifier ¶
UbuntuProNotifier is a function that is called when the Ubuntu Pro subscription changes.