umclient

package
v0.0.0-...-9b8e8df Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateIdle = iota
	StatePrepared
	StateUpdated
	StateFailed
)

UM states.

View Source
const (
	StatusInstalled = iota
	StatusInstalling
	StatusError
)

Component statuses.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateProvider

type CertificateProvider interface {
	GetNodeID() (string, error)
	GetCertificate(certType string) (certURL, ketURL string, err error)
}

CertificateProvider interface to get certificate.

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Client UM client instance.

func New

func New(cfg *config.Config, messageHandler MessageHandler, certProvider CertificateProvider,
	cryptocontext *cryptutils.CryptoContext, insecure bool,
) (client *Client, err error)

New creates new UM client.

func (*Client) Close

func (client *Client) Close() (err error)

Close closes UM client.

type ComponentStatus

type ComponentStatus int32

ComponentStatus component status.

func (ComponentStatus) String

func (status ComponentStatus) String() string

type ComponentStatusInfo

type ComponentStatusInfo struct {
	ID            string
	VendorVersion string
	AosVersion    uint64
	Status        ComponentStatus
	Error         string
}

ComponentStatusInfo component status info.

type ComponentUpdateInfo

type ComponentUpdateInfo struct {
	ID            string
	VendorVersion string
	AosVersion    uint64
	Annotations   json.RawMessage
	URL           string
	Sha256        []byte
	Sha512        []byte
	Size          uint64
}

ComponentUpdateInfo component update info.

type MessageHandler

type MessageHandler interface {
	// Registered indicates the client registered on the server
	Registered()
	// PrepareUpdate prepares update
	PrepareUpdate(components []ComponentUpdateInfo)
	// StartUpdate starts update
	StartUpdate()
	// ApplyUpdate applies update
	ApplyUpdate()
	// RevertUpdate reverts update
	RevertUpdate()
	// StatusChannel returns status channel
	StatusChannel() (channel <-chan Status)
}

MessageHandler incoming messages handler.

type Status

type Status struct {
	State      UMState
	Error      string
	Components []ComponentStatusInfo
}

Status update manager status.

type UMState

type UMState int32

UMState UM state.

func (UMState) String

func (state UMState) String() string

Jump to

Keyboard shortcuts

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