Documentation ¶
Index ¶
- func EchoCtxWithKeys(keys []string, values ...interface{}) echo.Context
- func HeaderValid() string
- func InsertMultiple(db *pg.DB, models ...interface{}) error
- func NewDB(t *testing.T, con *dockertest.Container, models ...interface{}) *pg.DB
- func NewPGContainer(t *testing.T) *dockertest.Container
- func TestTime(year int) time.Time
- type JWT
- type RBAC
- func (a RBAC) AccountCreate(c echo.Context, roleID homeschooling.AccessRole, companyID, locationID int) error
- func (a RBAC) EnforceCompany(c echo.Context, id int) error
- func (a RBAC) EnforceLocation(c echo.Context, id int) error
- func (a RBAC) EnforceRole(c echo.Context, role homeschooling.AccessRole) error
- func (a RBAC) EnforceUser(c echo.Context, id int) error
- func (a RBAC) IsLowerRole(c echo.Context, role homeschooling.AccessRole) error
- func (a RBAC) User(c echo.Context) homeschooling.AuthUser
- type Secure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EchoCtxWithKeys ¶
EchoCtxWithKeys returns new Echo context with keys
func InsertMultiple ¶
func InsertMultiple(db *pg.DB, models ...interface{}) error
InsertMultiple inserts multiple values into database
func NewDB ¶
func NewDB(t *testing.T, con *dockertest.Container, models ...interface{}) *pg.DB
NewDB instantiates new postgresql database connection via docker container
func NewPGContainer ¶
func NewPGContainer(t *testing.T) *dockertest.Container
NewPGContainer instantiates new PostgreSQL docker container
Types ¶
type JWT ¶
type JWT struct {
GenerateTokenFn func(homeschooling.User) (string, error)
}
JWT mock
func (JWT) GenerateToken ¶
func (j JWT) GenerateToken(u homeschooling.User) (string, error)
GenerateToken mock
type RBAC ¶
type RBAC struct { UserFn func(echo.Context) homeschooling.AuthUser EnforceRoleFn func(echo.Context, homeschooling.AccessRole) error EnforceUserFn func(echo.Context, int) error EnforceCompanyFn func(echo.Context, int) error EnforceLocationFn func(echo.Context, int) error AccountCreateFn func(echo.Context, homeschooling.AccessRole, int, int) error IsLowerRoleFn func(echo.Context, homeschooling.AccessRole) error }
RBAC Mock
func (RBAC) AccountCreate ¶
func (a RBAC) AccountCreate(c echo.Context, roleID homeschooling.AccessRole, companyID, locationID int) error
AccountCreate mock
func (RBAC) EnforceCompany ¶
EnforceCompany mock
func (RBAC) EnforceLocation ¶
EnforceLocation mock
func (RBAC) EnforceRole ¶
func (a RBAC) EnforceRole(c echo.Context, role homeschooling.AccessRole) error
EnforceRole mock
func (RBAC) IsLowerRole ¶
func (a RBAC) IsLowerRole(c echo.Context, role homeschooling.AccessRole) error
IsLowerRole mock
Click to show internal directories.
Click to hide internal directories.