store.go 703 B

12345678910111213141516171819202122
  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(accountId int) (*models.Account, error)
  14. GetOtherAccountsFor(accountId int) ([]*models.OtherAccount, error)
  15. Close()
  16. }
  17. func New() Store {
  18. return NewRethinkStore(&RethinkCfg{DatabaseName: "grafana"})
  19. }