ufs

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithNamespace

func ContextWithNamespace(ctx context.Context, namespace string) context.Context

ContextWithNamespace sets namespace to the context. If namespace is empty, it will use the default namespace.

func GetDutV1

func GetDutV1(ctx context.Context, hostname string) (*inventory.DeviceUnderTest, error)

func GetPools

func GetPools(ctx context.Context, client Client, hostname string) ([]string, error)

GetPools gets the pools associated with a particular bot or dut. UFSClient may be nil.

func NewHTTPClient

func NewHTTPClient(ctx context.Context) (*http.Client, error)

NewHTTPClient creates a new client specifically configured to talk to UFS correctly when run from CrOSSkyladAdmin dev or prod. It does not support other environments.

Types

type Client

Client exposes a deliberately chosen subset of the UFS functionality.

func NewClient

func NewClient(ctx context.Context, hc *http.Client, hostname string) (Client, error)

NewClient creates a new UFS client when given a hostname and a http client. The hostname should generally be read from the config.

type DeviceInfo

type DeviceInfo struct {
	Name  string
	Board string
	Model string
	Pools []string
}

DeviceInfo holds base device info.

func GetDeviceInfo

func GetDeviceInfo(ctx context.Context, client Client, hostname string) (*DeviceInfo, error)

GetDeviceInfo reads base device info from inventory.

type GetPoolsClient

type GetPoolsClient interface {
	GetMachineLSE(ctx context.Context, in *ufsAPI.GetMachineLSERequest, opts ...grpc.CallOption) (*models.MachineLSE, error)
}

GetPoolsClient expsoes the subset of the UFS client API needed by GetPools.

Directories

Path Synopsis
Package mockufs is a generated GoMock package.
Package mockufs is a generated GoMock package.

Jump to

Keyboard shortcuts

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