Documentation ¶
Overview ¶
Package influx provides the implementation of the browser.Database interface using InfluxDB as backend. It uses an in-memory cache based on maps guarded by a sync.RWMutex for storing data of queries like "SHOW TAG VALUES" which can be slow on large datasets.
Index ¶
- Variables
- type DB
- func (db *DB) GroupsByStation(ctx context.Context, id int64) ([]browser.Group, error)
- func (db *DB) Maintenance(ctx context.Context) ([]string, error)
- func (db *DB) Query(ctx context.Context, filter *browser.SeriesFilter) *browser.Stmt
- func (db *DB) Series(ctx context.Context, filter *browser.SeriesFilter) (browser.TimeSeries, error)
- type UserService
- func (s *UserService) Create(ctx context.Context, user *browser.User) error
- func (s *UserService) Delete(ctx context.Context, user *browser.User) error
- func (s *UserService) Get(ctx context.Context, user *browser.User) (*browser.User, error)
- func (s *UserService) Update(ctx context.Context, user *browser.User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CacheRefreshInterval is the interval in which the cache will be refreshed. CacheRefreshInterval = 8 * time.Hour )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB holds information for communicating with InfluxDB.
func NewDB ¶
NewDB returns a new instance of DB and initializes the internal caches and starts a new go routine for refreshing the cache on the defined CacheRefreshInterval.
func (*DB) GroupsByStation ¶
func (*DB) Series ¶
func (db *DB) Series(ctx context.Context, filter *browser.SeriesFilter) (browser.TimeSeries, error)
type UserService ¶
UserService represents an service for retrieving information of an authenticated user stored in InfluxDB.
Click to show internal directories.
Click to hide internal directories.