quartzdb

package module
v0.0.0-...-6e93ffc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2022 License: MIT Imports: 3 Imported by: 0

README

quartzdb-go

Go implementation of QuartzDB

Documentation

Overview

Package quartzdb implements QuartzDB client in go QuartzDB is flat-file database optimized to hold time-series data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QuartzDB

type QuartzDB struct {
	// contains filtered or unexported fields
}

QuartzDB contains the database interface

func NewQuartzDB

func NewQuartzDB(storage storage.QuartzDBStorage) *QuartzDB

NewQuartzDB creates new database instance given a storage client

func (QuartzDB) Add

func (q QuartzDB) Add(record storage.Record) (int, error)

Add appends a record to the database

func (QuartzDB) GetByDate

func (q QuartzDB) GetByDate(date time.Time) (*storage.Record, error)

GetByDate returns the first matching record by timestamp

func (QuartzDB) QueryLast

func (q QuartzDB) QueryLast(n int) ([]storage.Record, error)

QueryLast returns the last n records from the last shard

func (QuartzDB) QueryRange

func (q QuartzDB) QueryRange(from time.Time, to time.Time) ([]storage.Record, error)

QueryRange returns list of records dated between from and to timestamps

func (QuartzDB) QueryRangeCallback

func (q QuartzDB) QueryRangeCallback(from time.Time, to time.Time, callback storage.QueryCallback) error

QueryRangeCallback calls the callback function for each record that is dated between the from and to timestamps

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL