The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/stores/rethinkdb.go

45 lines
790 B

package stores
import (
"time"
r "github.com/dancannon/gorethink"
"github.com/torkelo/grafana-pro/pkg/log"
)
type rethinkStore struct {
session *r.Session
}
type RethinkCfg struct {
DatabaseName string
}
type Account struct {
Id int `gorethink:"id"`
NextDashboardId int
}
func NewRethinkStore(config *RethinkCfg) *rethinkStore {
log.Info("Initializing rethink storage")
session, err := r.Connect(r.ConnectOpts{
Address: "localhost:28015",
Database: config.DatabaseName,
MaxIdle: 10,
IdleTimeout: time.Second * 10,
})
if err != nil {
log.Error(3, "Failed to connect to rethink database %v", err)
}
createRethinkDBTablesAndIndices(config, session)
return &rethinkStore{
session: session,
}
}
func (self *rethinkStore) Close() {}