os

package
v0.0.0-...-ca2f5af Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReceiveOS

func ReceiveOS(stream pb.OS_InstallServer) (*bytes.Buffer, error)

ReceiveOS receives and parses requests from stream, storing OS package into a buffer, and updating the progress.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles requesting OS RPCs.

func NewClient

func NewClient(c *grpc.ClientConn) *Client

NewClient returns a new OS service client.

func (*Client) Activate

func (c *Client) Activate(ctx context.Context, version string) error

Activate invokes the Activate RPC for the OS service.

func (*Client) Install

func (c *Client) Install(ctx context.Context, imgPath, version string, validateTimeout time.Duration, chunkSize uint64) error

Install invokes the Install RPC for the OS service.

func (*Client) Verify

func (c *Client) Verify(ctx context.Context) (version, activationFailMsg string, err error)

Verify invokes the Verify RPC for the OS service.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager for storing data on OS's.

func NewManager

func NewManager(factoryVersion string) *Manager

NewManager for OS service module. Will manage state of OS module.

func (*Manager) Install

func (m *Manager) Install(version, activationFailMsg string)

Install installs an OS. It must be fully transferred and verified beforehand.

func (*Manager) IsInstalled

func (m *Manager) IsInstalled(version string) bool

IsInstalled returns true if the OS is installed.

func (*Manager) IsRunning

func (m *Manager) IsRunning(version string) bool

IsRunning will tell us whether or not the OS version specified is currently running.

func (*Manager) SetRunning

func (m *Manager) SetRunning(version string) error

SetRunning sets the running OS to the version specified.

type Server

type Server struct {
	pb.OSServer
	// contains filtered or unexported fields
}

Server is an OS Management service.

func NewServer

func NewServer(settings *Settings) *Server

NewServer returns an OS Management service.

func (*Server) Activate

func (s *Server) Activate(ctx context.Context, request *pb.ActivateRequest) (*pb.ActivateResponse, error)

Activate sets the requested OS version as the version which is used at the next reboot, and reboots the Target.

func (*Server) Install

func (s *Server) Install(stream pb.OS_InstallServer) error

Install receives an OS package, validates the package and then installs the package.

func (*Server) Register

func (s *Server) Register(g *grpc.Server)

Register registers the server into the the gRPC server provided.

func (*Server) Verify

func (s *Server) Verify(ctx context.Context, _ *pb.VerifyRequest) (*pb.VerifyResponse, error)

Verify returns the OS version currently running.

type Settings

type Settings struct {
	FactoryVersion      string
	InstalledVersions   []string
	ReceiveChunkSizeAck uint64
}

Settings wraps OS Server initialization options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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