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 ¶
- type Store
- func (s *Store) ClearProvisionableLabel(name string) error
- func (s *Store) Load() (*lab_platform.DutState, error)
- func (s *Store) LoadProvisionableLabel(name string) (string, error)
- func (s *Store) Save(ds *lab_platform.DutState) error
- func (s *Store) SetNonEmptyProvisionableLabel(name string, value string) error
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 ¶
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 ¶
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 ¶
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.