package
3.11.4+incompatible
Repository: https://github.com/whitewater-guide/gorge.git
Documentation: pkg.go.dev
# Functions
NewMeasurementsQuery builds db query from raw string arguments (passed via URL) If both TO and FROM are empty, a period of 30 days from current db time will be used If TO is empty string, current time from db will be used If given period is longer than 30 days, it will be trimmed to 30 days endig at TO timestamp.
NewSqliteDb creates SqliteManager with given chunkSize SqliteManager cannot be used for write access concurrently.
# Constants
NSLatest is redis namespace prefix for latest measurements.
NSStatus is redis namespace prefix for job/gauge statuses Cache structure is following hash: key -> field -> value -------------------- one-by-one jobs --------------------- status:<jobId> -> <code>:time -> ISO time string of latest job/code execution -> <code>:success -> ISO time string of latest SUCCESSFULL job/code execution -> <code>:count -> number of measurements harvested last time -> <code>:error -> latest execution error, or empty string in case of success
-------------------- jobs -------------------- status:jobs -> <jobId>:time -> ISO time string of latest job/code execution -> <jobId>:success -> ISO time string of latest SUCCESSFULL job/code execution -> <jobId>:count -> number of measurements harvested last time -> <jobId>:error -> latest execution error, or empty string in case of success.
# Variables
No description provided by the author
# Structs
DbManager implements DatabaseManager using sql database.
No description provided by the author
EmbeddedCacheManager is cache manager that uses embedded redis https://github.com/alicebob/miniredis.
MeasurementsQuery is intermediate data struct to convert HTTP request to database queries.
PostgresManager implements DatabaseManager interface.
RedisCacheManager is cache manager that uses real redis.
SqliteManager implements DatabaseManager interface for Sqlite datbase https://github.com/mattn/go-sqlite3.
# Interfaces
CacheManager manager is used to store latest measurement for each gauge and auxiliary information that is safe to lose.
DatabaseManager is used to store all harvested measurements it's also used to store jobs so that they persist between service restarts.