move context keys definition into main api file
This commit is contained in:
parent
605cf97298
commit
989f03040a
4 changed files with 12 additions and 12 deletions
|
|
@ -18,12 +18,6 @@ var (
|
||||||
ErrAccountValidation = errors.New("account validation error")
|
ErrAccountValidation = errors.New("account validation error")
|
||||||
)
|
)
|
||||||
|
|
||||||
type ctxKey int
|
|
||||||
|
|
||||||
const (
|
|
||||||
ctxAccount ctxKey = iota
|
|
||||||
)
|
|
||||||
|
|
||||||
// AccountStore defines database operations for account management.
|
// AccountStore defines database operations for account management.
|
||||||
type AccountStore interface {
|
type AccountStore interface {
|
||||||
List(f auth.AccountFilter) (*[]auth.Account, int, error)
|
List(f auth.AccountFilter) (*[]auth.Account, int, error)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,12 @@ const (
|
||||||
roleAdmin = "admin"
|
roleAdmin = "admin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type ctxKey int
|
||||||
|
|
||||||
|
const (
|
||||||
|
ctxAccount ctxKey = iota
|
||||||
|
)
|
||||||
|
|
||||||
// API provides admin application resources and handlers.
|
// API provides admin application resources and handlers.
|
||||||
type API struct {
|
type API struct {
|
||||||
Accounts *AccountResource
|
Accounts *AccountResource
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,6 @@ import (
|
||||||
"github.com/dhax/go-base/models"
|
"github.com/dhax/go-base/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ctxKey int
|
|
||||||
|
|
||||||
const (
|
|
||||||
ctxAccount ctxKey = iota
|
|
||||||
)
|
|
||||||
|
|
||||||
// AccountStore defines database operations for account.
|
// AccountStore defines database operations for account.
|
||||||
type AccountStore interface {
|
type AccountStore interface {
|
||||||
Get(id int) (*auth.Account, error)
|
Get(id int) (*auth.Account, error)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,12 @@ import (
|
||||||
"github.com/dhax/go-base/database"
|
"github.com/dhax/go-base/database"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type ctxKey int
|
||||||
|
|
||||||
|
const (
|
||||||
|
ctxAccount ctxKey = iota
|
||||||
|
)
|
||||||
|
|
||||||
// API provides application resources and handlers.
|
// API provides application resources and handlers.
|
||||||
type API struct {
|
type API struct {
|
||||||
Account *AccountResource
|
Account *AccountResource
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue