botcache

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

Documentation

Overview

Package botcache provides an interface to interact with data cached in a swarming bot corresponding to a Chrome OS DUT.package botcache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// The top-level bot cache directory.
	// Usually the autotest results directory.
	CacheDir string
	// Bot specific identity.
	// Usually the DUT name (deprecated: Dut inventory ID).
	Name string
}

Store exposes methods to read / write the contents of the bot cache.

func (*Store) ClearProvisionableLabel

func (s *Store) ClearProvisionableLabel(name string) error

ClearProvisionableLabel deletes a particular provisionable label from the bot cache.

func (*Store) Load

func (s *Store) Load() (*lab_platform.DutState, error)

Load reads the contents of the bot cache.

func (*Store) LoadProvisionableLabel

func (s *Store) LoadProvisionableLabel(name string) (string, error)

LoadProvisionableLabel reads the value of the given provisionable label from the bot cache.

LoadProvisionableLabel returns an empty string if the provided key does not exist in the provisionable labels in bot cache.

func (*Store) Save

func (s *Store) Save(ds *lab_platform.DutState) error

Save overwrites the contents of the bot cache with provided DutState.

func (*Store) SetNonEmptyProvisionableLabel

func (s *Store) SetNonEmptyProvisionableLabel(name string, value string) error

SetNonEmptyProvisionableLabel sets the given provisionable label in the bot cache, provided the given value is not an empty string. Empty provisionable labels should never be set in the bot cache, and will result in an error.

Use ClearProvisionableLabel to delete a label from cache.

Jump to

Keyboard shortcuts

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