Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedDataStorageDriver = errors.New("unsupported data storage driver")
)
Functions ¶
func ToDataStorage ¶
func ToDataStorage(ds *DataStorage) func(string, interface{}) error
Types ¶
type DataStorage ¶
type DataStorage interface { Write(ctx context.Context, measurement string, tags map[string]string, data map[string]interface{}) error Query(ctx context.Context, measurement string, tags map[string]string, opts ...QueryOption) (QueryResult, error) }
func NewDataStorage ¶
func NewDataStorage(name string, args ...interface{}) (DataStorage, error)
func NewDummyDataStorage ¶
func NewDummyDataStorage(args ...interface{}) (DataStorage, error)
func NewInfluxdb2DataStorage ¶
func NewInfluxdb2DataStorage(args ...interface{}) (DataStorage, error)
type DataStorageFactory ¶
type DataStorageFactory func(...interface{}) (DataStorage, error)
type DummyDataStorage ¶
type DummyDataStorage struct {
// contains filtered or unexported fields
}
func (*DummyDataStorage) Query ¶ added in v1.2.5
func (s *DummyDataStorage) Query(ctx context.Context, measurement string, tags map[string]string, opts ...QueryOption) (QueryResult, error)
type Influxdb2DataStorage ¶
type Influxdb2DataStorage struct {
// contains filtered or unexported fields
}
func (*Influxdb2DataStorage) Query ¶ added in v1.2.5
func (s *Influxdb2DataStorage) Query(ctx context.Context, measurement string, tags map[string]string, opts ...QueryOption) (QueryResult, error)
type Influxdb2DataStorageOption ¶
type Influxdb2DataStorageOption struct { Address string Token string Username string Password string Org string Bucket string QueryPageSize int32 QueryRangeFromOffset time.Duration }
func NewInfluxdb2DataStorageOption ¶ added in v1.2.5
func NewInfluxdb2DataStorageOption() *Influxdb2DataStorageOption
type MockDataStorage ¶
func (*MockDataStorage) Query ¶ added in v1.2.5
func (m *MockDataStorage) Query(ctx context.Context, measurement string, tags map[string]string, opts ...QueryOption) (QueryResult, error)
func (*MockDataStorage) SetQueryResult ¶ added in v1.2.5
func (m *MockDataStorage) SetQueryResult(qr QueryResult)
type QueryOption ¶ added in v1.2.5
type QueryOption func(map[string]interface{})
func PageSize ¶ added in v1.2.5
func PageSize(size int32) QueryOption
func PageToken ¶ added in v1.2.5
func PageToken(token string) QueryOption
func QueryString ¶ added in v1.2.5
func QueryString(s string) QueryOption
func RangeFrom ¶ added in v1.2.5
func RangeFrom(t time.Time) QueryOption
func RangeTo ¶ added in v1.2.5
func RangeTo(t time.Time) QueryOption
type QueryRecord ¶ added in v1.2.5
func NewQueryRecord ¶ added in v1.2.5
func NewQueryRecord(tm time.Time, dat map[string]interface{}) QueryRecord
type QueryResult ¶ added in v1.2.5
type QueryResult interface { Records() []QueryRecord NextPageToken() string }
func NewQueryResult ¶ added in v1.2.5
func NewQueryResult(recs []QueryRecord, npt string) QueryResult
Click to show internal directories.
Click to hide internal directories.