Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRecordsForURL ¶
GetRecordsForURL gets records from the database for all the given URLs the records timestamp is bounded between and [origin - timeframe, origin]
func WriteLogToDB ¶
func WriteLogToDB(responseLog request.ResponseLog) error
WriteLogToDB writes logs to our database
Types ¶
type Database ¶
type Database interface { Initialize() error GetDatabaseName() string AddResponseLog(responseLog request.ResponseLog) error GetRangeRecords(span int) []client.Result }
Database interface abstracts the interactions woth influxDB and provides and database agnostic interface for use
type InfluxDb ¶
type InfluxDb struct { Host string `json:"host"` Port int `json:"port"` DatabaseName string `json:"databaseName"` Username string `json:"username"` Password string `json:"password"` }
func (InfluxDb) AddRecord ¶
func (influxDb InfluxDb) AddRecord(responseLog request.ResponseLog) error
AddRecord adds a new record to InfluxDB
func (InfluxDb) GetRecordsForURL ¶
func (influxDb InfluxDb) GetRecordsForURL(url string, origin time.Time, timeframe int64) []request.ResponseLog
GetRecordsForURL sends a query to InfluxDB to get records of a given URL, older than a given "origin" and restricted by a given timeframe
Click to show internal directories.
Click to hide internal directories.