Documentation ¶
Index ¶
- func InitDatabase() error
- type History
- type HistoryMessage
- type Reader
- func (reader *Reader) GetHistoryEntries(target string) (History, error)
- func (reader *Reader) GetHistoryEntriesFrom(target string, from time.Time) (History, error)
- func (reader *Reader) GetHistoryEntriesFromThinned(target string, from time.Time, maxDensity time.Duration) (History, error)
- func (reader *Reader) GetHistoryEntriesFromUntil(target string, from time.Time, until time.Time) (History, error)
- func (reader *Reader) GetHistoryEntriesFromUntilThinned(target string, from time.Time, until time.Time, maxDensity time.Duration) (History, error)
- func (reader *Reader) GetHistoryEntriesThinned(target string, maxDensity time.Duration) (History, error)
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitDatabase ¶
func InitDatabase() error
InitDatabase initializes the database connection and starts all recurring jobs on the database.
Types ¶
type History ¶
type History []HistoryMessage
type HistoryMessage ¶
type HistoryMessage struct { Timestamp time.Time `json:"timestamp"` Message struct { Target string `json:"target"` Value string `json:"value"` } `json:"message"` }
HistoryMessage serves as a model to describe entries in the history table.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) GetHistoryEntries ¶
GetHistoryEntries gets history all entries from the loaded database file
func (*Reader) GetHistoryEntriesFrom ¶
GetHistoryEntriesFrom gets History entries after "from"
func (*Reader) GetHistoryEntriesFromThinned ¶
func (reader *Reader) GetHistoryEntriesFromThinned(target string, from time.Time, maxDensity time.Duration) (History, error)
GetHistoryEntriesFromThinned thins out the history data gathered from GetHistoryEntriesFrom to be at least as spread apart as defined in maxDensity
func (*Reader) GetHistoryEntriesFromUntil ¶
func (reader *Reader) GetHistoryEntriesFromUntil(target string, from time.Time, until time.Time) (History, error)
GetHistoryEntriesFromUntil gets History entries after "from" and before "until"
func (*Reader) GetHistoryEntriesFromUntilThinned ¶
func (reader *Reader) GetHistoryEntriesFromUntilThinned(target string, from time.Time, until time.Time, maxDensity time.Duration) (History, error)
GetHistoryEntriesFromUntilThinned thins out the history data gathered from GetHistoryEntriesFromUntil to be at least as speread apart as defined in maxDensity