version

package
v0.0.0-...-350d524 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package version provides a wrapper over version service to simplify usage in recovery lib.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient

func WithClient(ctx context.Context, c VersionClient) context.Context

WithClient sets VersionClient to the context. If Client is not provided process will be finished with panic.

Types

type Data

type Data interface {
	GetOsVersion() string
	GetOsImagePath() string
	GetFirmwareRoVersion() string
	GetFirmwareRoImagePath() string
}

Data provides access to versions data.

func ByDetails

func ByDetails(ctx context.Context, versionType Type, deviceName, board, model string, pools []string) (Data, error)

ByDetails finds version by board, model and pools info.

func ByDut

func ByDut(ctx context.Context, dut *tlw.Dut) (Data, error)

ByDut finds version for DUT.

func ByResource

func ByResource(ctx context.Context, versionType Type, dut *tlw.Dut, resource string) (Data, error)

ByResource finds version by resource in correlation with version-type by finding board, model and pools infos.

type Type

type Type string

Type represents type of version data per type of target device.

const (
	UnspecifiedType Type = ""
	// Chrome OS.
	CrOSType Type = "cros"
	// AP/PCAP peripheral.
	WifiRouterType Type = "wifi_router"
	// Tablet for camera-box.
	CameraBoxTabletType Type = "camera_box_tablet"
	// Android for ChromeOS.
	AndroidOSType Type = "androidos"
)

func ToType

func ToType(t string) Type

ToType converts string to Type.

type VersionClient

type VersionClient interface {
	GetRecoveryVersion(ctx context.Context, in *fleet.GetRecoveryVersionRequest, opts ...grpc.CallOption) (*fleet.GetRecoveryVersionResponse, error)
}

VersionClient is a client that provide access to read recovery versions by RPC call.

func GetClient

func GetClient(ctx context.Context) VersionClient

GetClient VersionClient from context.

Jump to

Keyboard shortcuts

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