move context keys definition into main api file

This commit is contained in:
dhax 2017-10-09 01:48:58 +02:00
parent 605cf97298
commit 989f03040a
4 changed files with 12 additions and 12 deletions

View file

@ -18,12 +18,6 @@ var (
ErrAccountValidation = errors.New("account validation error")
)
type ctxKey int
const (
ctxAccount ctxKey = iota
)
// AccountStore defines database operations for account management.
type AccountStore interface {
List(f auth.AccountFilter) (*[]auth.Account, int, error)

View file

@ -17,6 +17,12 @@ const (
roleAdmin = "admin"
)
type ctxKey int
const (
ctxAccount ctxKey = iota
)
// API provides admin application resources and handlers.
type API struct {
Accounts *AccountResource

View file

@ -15,12 +15,6 @@ import (
"github.com/dhax/go-base/models"
)
type ctxKey int
const (
ctxAccount ctxKey = iota
)
// AccountStore defines database operations for account.
type AccountStore interface {
Get(id int) (*auth.Account, error)

View file

@ -7,6 +7,12 @@ import (
"github.com/dhax/go-base/database"
)
type ctxKey int
const (
ctxAccount ctxKey = iota
)
// API provides application resources and handlers.
type API struct {
Account *AccountResource