Documentation ¶
Overview ¶
Package mock contains logic to mock various components of the application
Index ¶
- func EchoCtxWithKeys(keys []string, values ...interface{}) echo.Context
- func HeaderInvalid() string
- func HeaderValid() string
- 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 models.AccessRole, accountID, teamID uint) error
- func (a *RBAC) EnforceAccount(c echo.Context, id uint) error
- func (a *RBAC) EnforceRole(c echo.Context, role models.AccessRole) error
- func (a *RBAC) EnforceTeam(c echo.Context, id uint) error
- func (a *RBAC) EnforceUser(c echo.Context, id uint) error
- func (a *RBAC) IsLowerRole(c echo.Context, role models.AccessRole) error
- func (a *RBAC) User(c echo.Context) *models.AuthUser
- type Secure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EchoCtxWithKeys ¶
EchoCtxWithKeys returns new Echo context with keys
func TestTimePtr ¶
TestTimePtr is used for testing pointer time fields
Types ¶
type RBAC ¶
type RBAC struct { UserFn func(echo.Context) *models.AuthUser EnforceRoleFn func(echo.Context, models.AccessRole) error EnforceUserFn func(echo.Context, uint) error EnforceAccountFn func(echo.Context, uint) error EnforceTeamFn func(echo.Context, uint) error AccountCreateFn func(echo.Context, models.AccessRole, uint, uint) error IsLowerRoleFn func(echo.Context, models.AccessRole) error }
RBAC Mock
func (*RBAC) AccountCreate ¶
func (a *RBAC) AccountCreate(c echo.Context, roleID models.AccessRole, accountID, teamID uint) error
AccountCreate mock
func (*RBAC) EnforceAccount ¶
EnforceAccount mock
func (*RBAC) EnforceRole ¶
EnforceRole mock
func (*RBAC) EnforceTeam ¶
EnforceTeam mock
func (*RBAC) EnforceUser ¶
EnforceUser mock
func (*RBAC) IsLowerRole ¶
IsLowerRole mock
Click to show internal directories.
Click to hide internal directories.