store.go 628 B

123456789101112131415161718192021
  1. package stores
  2. import (
  3. "github.com/torkelo/grafana-pro/pkg/models"
  4. )
  5. type Store interface {
  6. GetDashboard(slug string, accountId int) (*models.Dashboard, error)
  7. SaveDashboard(dash *models.Dashboard) error
  8. DeleteDashboard(slug string, accountId int) error
  9. Query(query string, acccountId int) ([]*models.SearchResult, error)
  10. CreateAccount(acccount *models.Account) error
  11. UpdateAccount(acccount *models.Account) error
  12. GetAccountByLogin(emailOrName string) (*models.Account, error)
  13. GetAccount(id int) (*models.Account, error)
  14. Close()
  15. }
  16. func New() Store {
  17. return NewRethinkStore(&RethinkCfg{DatabaseName: "grafana"})
  18. }