pub struct Lava { /* private fields */ }
Expand description
A local proxy for a LAVA server
This provides convenient access to some of the data stored on a LAVA server, including jobs, devices, tags and workers.
Implementations§
source§impl Lava
impl Lava
sourcepub fn new(url: &str, token: Option<String>) -> Result<Lava, LavaError>
pub fn new(url: &str, token: Option<String>) -> Result<Lava, LavaError>
Create a new Lava proxy
Here url
is the address of the server, and token
is an
optional LAVA security token used to validate access.
Refresh the tag cache
Tags are cached to make lookup cheaper, and because the number of jobs can be very large: resolving tags individually for each job would be extremely slow. The cache has to be periodically refreshed to account for changes.
Note that tags are automatically refreshed by calling
tag
or tags
, but not by calling
devices
or jobs
.
Retrieve all the tags from the server
The returned data is not a stream, but a flat vector when the method succeeds. This also updates the tag cache.
pub fn log(&self, id: i64) -> JobLogBuilder<'_>
sourcepub fn jobs(&self) -> JobsBuilder<'_>
pub fn jobs(&self) -> JobsBuilder<'_>
Obtain a customisable query object for Job
instances on the server.
The returned JobsBuilder
can be used first to select the
subset of jobs that will be returned, and then after that is
complete to obtain a stream of matching jobs. The default
query is the same as that for JobsBuilder::new
.