Documentation ¶
Overview ¶
Package landscape implements a client to the Landscape Host Agent API service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudInit ¶
type CloudInit interface { WriteDistroData(distroName string, cloudInit string) error RemoveDistroData(distroName string) error }
CloudInit is a cloud-init user data writer.
type Config ¶
type Config interface { LandscapeClientConfig() (string, config.Source, error) Subscription() (string, config.Source, error) LandscapeAgentUID() (string, error) SetLandscapeAgentUID(context.Context, string) error }
Config is a configuration provider for ProToken and the Landscape URL.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is a light-weight structure used to send certain instructions to the Landscape service.
func (Controller) Reconnect ¶
func (c Controller) Reconnect(ctx context.Context) (succcess bool)
Reconnect makes Landscape drop its current connection and start a new one. Blocks until the new connection is available (or failed).
func (Controller) SendUpdatedInfo ¶
func (c Controller) SendUpdatedInfo(ctx context.Context) error
SendUpdatedInfo sends a message to the Landscape server with updated info about the machine and the distros.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service orquestrates the Landscape hostagent connection. It lasts for the entire lifetime of the program. It creates the executor and ensures there is always an active connection, creating a new one if necessary.
func New ¶
func New(ctx context.Context, conf Config, db *database.DistroDB, cloudInit CloudInit, args ...Option) (s *Service, err error)
New creates a new Landscape service object.
func (*Service) Connect ¶
Connect starts the connection and starts talking to the server. Call Stop to deallocate resources.
func (*Service) Controller ¶
func (s *Service) Controller() Controller
Controller creates a controler for this service.
func (*Service) NotifyConfigUpdate ¶
NotifyConfigUpdate is called when the configuration changes. It will trigger a reconnection if needed.
func (*Service) NotifyUbuntuProUpdate ¶
NotifyUbuntuProUpdate is called when the Ubuntu Pro token changes. It will trigger a reconnection if needed.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package distroinstall exists to implement various utilities used by landscape that need to be mocked in tests.
|
Package distroinstall exists to implement various utilities used by landscape that need to be mocked in tests. |