ufsdutinfo

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package ufsdutinfo implement loading Skylab DUT inventory(UFS) info for the worker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	DUT *inventory.DeviceUnderTest

	StableVersions map[string]string
	// contains filtered or unexported fields
}

Store holds a DUT's inventory info and adds a Close method.

func LoadByHostname

func LoadByHostname(ctx context.Context, b *swmbot.Info, hostname string, f UpdateFunc) (*Store, error)

LoadByHostname loads the DUT's info from the UFS by hostname. This function returns a Store that should be closed to update the inventory with any changes to the info, using a supplied UpdateFunc. If UpdateFunc is nil, the inventory is not updated.

func LoadByID

func LoadByID(ctx context.Context, b *swmbot.Info, dutID string, f UpdateFunc) (*Store, error)

LoadByID loads the DUT's info from the UFS by ID. This function returns a Store that should be closed to update the inventory with any changes to the info, using a supplied UpdateFunc. If UpdateFunc is nil, the inventory is not updated.

func (*Store) Close

func (s *Store) Close(ctx context.Context) error

Close updates the DUT's inventory info. This method does nothing on subsequent calls. This method is safe to call on a nil pointer.

type UpdateFunc

type UpdateFunc func(ctx context.Context, dutID string, old *inventory.DeviceUnderTest, new *inventory.DeviceUnderTest) error

UpdateFunc is used to implement inventory updating for any changes to the loaded DUT info.

Jump to

Keyboard shortcuts

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