Documentation ¶
Index ¶
- func GinCtxWithKeys(keys []string, values ...interface{}) *gin.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 Auth
- type JWT
- type Mail
- type Mobile
- type Password
- type RBAC
- func (a *RBAC) AccountCreate(c *gin.Context, roleID, companyID, locationID int) bool
- func (a *RBAC) EnforceCompany(c *gin.Context, id int) bool
- func (a *RBAC) EnforceLocation(c *gin.Context, id int) bool
- func (a *RBAC) EnforceRole(c *gin.Context, role model.AccessRole) bool
- func (a *RBAC) EnforceUser(c *gin.Context, id int) bool
- func (a *RBAC) IsLowerRole(c *gin.Context, role model.AccessRole) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinCtxWithKeys ¶
GinCtxWithKeys returns new gin context with keys
func TestTimePtr ¶
TestTimePtr is used for testing pointer time fields
Types ¶
type Mail ¶
type Mail struct { ExternalURL string SendFn func(string, string, string, string) error SendWithDefaultsFn func(string, string, string) error SendVerificationEmailFn func(string, *model.Verification) error }
Mail mock
func (*Mail) SendVerificationEmail ¶
func (m *Mail) SendVerificationEmail(toEmail string, v *model.Verification) error
SendVerificationEmail mock
func (*Mail) SendWithDefaults ¶
SendWithDefaults mock
type Mobile ¶
type Mobile struct { GenerateSMSTokenFn func(string, string) error CheckCodeFn func(string, string, string) error }
Mobile mock
func (*Mobile) GenerateSMSToken ¶
GenerateSMSToken mock
type Password ¶
type Password struct { HashPasswordFn func(string) string HashMatchesPasswordFn func(hash, password string) bool HashRandomPasswordFn func() (string, error) }
Password mock
func (*Password) HashMatchesPassword ¶
HashMatchesPassword mock
func (*Password) HashPassword ¶
HashPassword mock
func (*Password) HashRandomPassword ¶
HashRandomPassword mock
type RBAC ¶
type RBAC struct { EnforceRoleFn func(*gin.Context, model.AccessRole) bool EnforceUserFn func(*gin.Context, int) bool EnforceCompanyFn func(*gin.Context, int) bool EnforceLocationFn func(*gin.Context, int) bool AccountCreateFn func(*gin.Context, int, int, int) bool IsLowerRoleFn func(*gin.Context, model.AccessRole) bool }
RBAC Mock
func (*RBAC) AccountCreate ¶
AccountCreate mock
func (*RBAC) EnforceCompany ¶
EnforceCompany mock
func (*RBAC) EnforceLocation ¶
EnforceLocation mock
func (*RBAC) EnforceRole ¶
EnforceRole mock
func (*RBAC) IsLowerRole ¶
IsLowerRole mock
Source Files ¶
Click to show internal directories.
Click to hide internal directories.