Documentation
¶
Index ¶
- Constants
- Variables
- func FromSenmlTime(t float64) time.Time
- func ToSenmlTime(t time.Time) float64
- type DenormMask
- type Query
- type SenMLDBRecord
- type SenmlDataStore
- func (bdb SenmlDataStore) Add(senmlPack senml.Pack) error
- func (bdb *SenmlDataStore) Connect(path string) error
- func (bdb SenmlDataStore) Create(name string) error
- func (bdb *SenmlDataStore) Delete(series string) error
- func (bdb SenmlDataStore) Disconnect() error
- func (bdb SenmlDataStore) Get(series string) (senml.Pack, error)
- func (bdb SenmlDataStore) GetPages(query Query) ([]float64, int, error)
- func (bdb SenmlDataStore) Query(query Query) (senml.Pack, *float64, error)
Constants ¶
View Source
const ( ASC = "asc" DESC = "desc" )
Variables ¶
View Source
var (
ErrSeriesNotFound = errors.New("timeseries not found")
)
Functions ¶
func FromSenmlTime ¶
func ToSenmlTime ¶
Types ¶
type DenormMask ¶
type DenormMask int
const ( FName DenormMask = 1 << iota FTime FUnit FValue FSum )
type Query ¶
type Query struct {
//A comma separated senml names
Series string
From float64
To float64
//Sorting order:
//Possible values are ASC and DESC
//ASC : The time Series will have the oldest data first
//DESC: The time Series will have the latest data first.
Sort string
//Number of entries to be returned per request. This is used for pagination. The next sequence is found out using NextEntry function
MaxEntries int
//comma separated fields for denormalization (see https://tools.ietf.org/html/rfc8428#section-4.6). Currently only "name" and "time" are supported.
Denormalize DenormMask
}
type SenMLDBRecord ¶
type SenMLDBRecord struct {
Unit string `json:"u,omitempty" `
UpdateTime float64 `json:"ut,omitempty"`
Value *float64 `json:"v,omitempty" `
StringValue string `json:"vs,omitempty" `
DataValue string `json:"vd,omitempty" `
BoolValue *bool `json:"vb,omitempty" `
Sum *float64 `json:"s,omitempty" `
}
func NewBoltSenMLRecord ¶
func NewBoltSenMLRecord(record senml.Record) SenMLDBRecord
type SenmlDataStore ¶
type SenmlDataStore struct {
// contains filtered or unexported fields
}
func (*SenmlDataStore) Connect ¶
func (bdb *SenmlDataStore) Connect(path string) error
func (SenmlDataStore) Create ¶
func (bdb SenmlDataStore) Create(name string) error
Create a new bucket
func (*SenmlDataStore) Delete ¶
func (bdb *SenmlDataStore) Delete(series string) error
func (SenmlDataStore) Disconnect ¶
func (bdb SenmlDataStore) Disconnect() error
Click to show internal directories.
Click to hide internal directories.