Humiex.State (humiex v0.2.3) View Source
Stores a Humiex Query/Stream search state
Allows Humiex.stream/1 and Humiex.stream_values/1 to resume a Search from a previous one
Link to this section Summary
Types
A Humiex State struct stores the client and query configuration alongside execution metadata such as the latest seen event timestamp and event ids
Link to this section Types
Specs
absolute_time() :: number()
Specs
event_id() :: String.t()
Specs
maybe_time() :: time() | nil
Specs
relative_time() :: String.t()
Specs
t() :: %Humiex.State{
chunk: binary() | nil,
client: Humiex.Client.t(),
end_time: maybe_time(),
event_count: number(),
last_timestamp: number(),
latest_ids: [event_id()],
opts: keyword(),
query_string: String.t(),
resp: any(),
response_code: number() | nil,
start_time: maybe_time(),
status: :ok | :error | nil
}
A Humiex State struct stores the client and query configuration alongside execution metadata such as the latest seen event timestamp and event ids
:clientHumiex Client configuration:query_stringHumio search API queryString:start_timeHumio search API start time specification:end_timeHumio search API end time specification:optsKeyword of additional options such as:live?uses a live query if set totrue:state_destallows to send the Humiex.State as a message to a process when usingstream_values/4
:respHolds a reference to the Client that implements HTTPAsyncBehaviour and it's used to execute the requests:last_timestampLast seen timestamp:latest_idsList of the seen event ids for the last timestamp:event_countNumber of events returned so far:chunkInternal buffer used to hold the raw api responses before decoding the events
Specs
time() :: relative_time() | absolute_time()