Documentation ¶
Index ¶
- func EchoCtxWithKeys(keys []string, values ...interface{}) echo.Context
- func HeaderInvalid() string
- 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 Str2Ptr(s string) *string
- func TestTime(year int) time.Time
- func TestTimePtr(year int) *time.Time
- type JWT
- type RBAC
- func (a *RBAC) AccountCreate(c echo.Context, roleID gorsk.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 gorsk.AccessRole) error
- func (a *RBAC) EnforceUser(c echo.Context, id int) error
- func (a *RBAC) IsLowerRole(c echo.Context, role gorsk.AccessRole) error
- func (a *RBAC) User(c echo.Context) *gorsk.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 ¶
InsertMultiple inserts multiple values into database
func NewPGContainer ¶
func NewPGContainer(t *testing.T) *dockertest.Container
NewPGContainer instantiates new PostgreSQL docker container
func TestTimePtr ¶
TestTimePtr is used for testing pointer time fields
Types ¶
type RBAC ¶
type RBAC struct { UserFn func(echo.Context) *gorsk.AuthUser EnforceRoleFn func(echo.Context, gorsk.AccessRole) error EnforceUserFn func(echo.Context, int) error EnforceCompanyFn func(echo.Context, int) error EnforceLocationFn func(echo.Context, int) error AccountCreateFn func(echo.Context, gorsk.AccessRole, int, int) error IsLowerRoleFn func(echo.Context, gorsk.AccessRole) error }
RBAC Mock
func (*RBAC) AccountCreate ¶
func (a *RBAC) AccountCreate(c echo.Context, roleID gorsk.AccessRole, companyID, locationID int) error
AccountCreate mock
func (*RBAC) EnforceCompany ¶
EnforceCompany mock
func (*RBAC) EnforceLocation ¶
EnforceLocation mock
func (*RBAC) EnforceRole ¶
EnforceRole mock
func (*RBAC) EnforceUser ¶
EnforceUser mock
func (*RBAC) IsLowerRole ¶
IsLowerRole mock
Click to show internal directories.
Click to hide internal directories.