cmserver

package
v0.0.0-...-2b5bdcb Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMServer

type CMServer struct {
	pb.UnimplementedUpdateSchedulerServiceServer

	sync.Mutex
	// contains filtered or unexported fields
}

CMServer CM server instance.

func New

func New(
	cfg *config.Config, handler UpdateHandler, certProvider CertificateProvider,
	cryptcoxontext *cryptutils.CryptoContext, insecure bool,
) (server *CMServer, err error)

New creates new IAM server instance.

func (*CMServer) Close

func (server *CMServer) Close()

Close stops CM server.

func (*CMServer) StartFOTAUpdate

func (server *CMServer) StartFOTAUpdate(ctx context.Context, req *empty.Empty) (ret *empty.Empty, err error)

StartFOTAUpdate triggers FOTA update.

func (*CMServer) StartSOTAUpdate

func (server *CMServer) StartSOTAUpdate(ctx context.Context, req *empty.Empty) (ret *empty.Empty, err error)

StartSOTAUpdate triggers SOTA update.

func (*CMServer) SubscribeNotifications

func (server *CMServer) SubscribeNotifications(
	req *empty.Empty, stream pb.UpdateSchedulerService_SubscribeNotificationsServer,
) (err error)

SubscribeNotifications sunscribes on SOTA FOTA packages status changes.

type CertificateProvider

type CertificateProvider interface {
	GetCertificate(certType string, issuer []byte, serial string) (certURL, keyURL string, err error)
}

CertificateProvider certificate and key provider interface.

type UpdateFOTAStatus

type UpdateFOTAStatus struct {
	Components []cloudprotocol.ComponentStatus
	UnitConfig *cloudprotocol.UnitConfigStatus
	UpdateStatus
}

UpdateFOTAStatus FOTA update status for update scheduler service.

type UpdateHandler

type UpdateHandler interface {
	GetFOTAStatusChannel() (channel <-chan UpdateFOTAStatus)
	GetSOTAStatusChannel() (channel <-chan UpdateSOTAStatus)
	GetFOTAStatus() (status UpdateFOTAStatus)
	GetSOTAStatus() (status UpdateSOTAStatus)
	StartFOTAUpdate() (err error)
	StartSOTAUpdate() (err error)
}

UpdateHandler interface for SOTA/FOTA update.

type UpdateSOTAStatus

type UpdateSOTAStatus struct {
	InstallServices []cloudprotocol.ServiceStatus
	RemoveServices  []cloudprotocol.ServiceStatus
	InstallLayers   []cloudprotocol.LayerStatus
	RemoveLayers    []cloudprotocol.LayerStatus
	UpdateStatus
}

UpdateSOTAStatus SOTA update status for update scheduler service.

type UpdateState

type UpdateState int

UpdateState type for update state.

const (
	NoUpdate UpdateState = iota
	Downloading
	ReadyToUpdate
	Updating
)

Update states.

func (UpdateState) String

func (state UpdateState) String() string

type UpdateStatus

type UpdateStatus struct {
	State UpdateState
	Error string
}

UpdateStatus represents SOTA/FOTA status.

Jump to

Keyboard shortcuts

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