Documentation ¶
Index ¶
- type Context
- func (c *Context) BindParamsFromBody(obj any) (err error)
- func (c *Context) BindParamsFromQuery(obj any) (err error)
- func (c *Context) GetCodeFromUrl() string
- func (c *Context) GetId2FromUrl() (uint, error)
- func (c *Context) GetIdFromUrl() (uint, error)
- func (c *Context) GetPagingParams() (offset int, limit int, errV error)
- func (c *Context) GetParamAsBool(name string, defValue bool) (bool, error)
- func (c *Context) GetParamAsInt(name string, defValue int) (int, error)
- func (c *Context) GetParamAsString(name string, defValue string) string
- func (c *Context) ReturnError(err error)
- func (c *Context) ReturnList(result any, offset int, limit int, size int) error
- func (c *Context) ReturnObject(data any) error
- type OidcController
- type RestService
- type UserSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶ added in v1.2.0
type Context struct { Gin *gin.Context Session *UserSession Log *slog.Logger Config any Token string }
func (*Context) BindParamsFromBody ¶ added in v1.2.1
func (*Context) BindParamsFromQuery ¶ added in v1.2.1
func (*Context) GetCodeFromUrl ¶ added in v1.2.1
func (*Context) GetId2FromUrl ¶ added in v1.7.7
func (*Context) GetIdFromUrl ¶ added in v1.2.1
func (*Context) GetPagingParams ¶ added in v1.2.1
func (*Context) GetParamAsBool ¶ added in v1.6.1
func (*Context) GetParamAsInt ¶ added in v1.6.1
func (*Context) GetParamAsString ¶ added in v1.7.3
func (*Context) ReturnError ¶ added in v1.2.1
func (*Context) ReturnList ¶ added in v1.2.1
func (*Context) ReturnObject ¶ added in v1.2.1
type OidcController ¶
type OidcController struct {
// contains filtered or unexported fields
}
func NewOidcController ¶
func (*OidcController) Secure ¶
func (oc *OidcController) Secure(h RestService, roles []role.Role) func(c *gin.Context)
type RestService ¶ added in v1.2.0
type RestService func(c *Context)
type UserSession ¶
type UserSession struct { SessionID string Username string Name string Surname string Email string IssuedAt time.Time Expiry time.Time Roles map[role.Role]any }
func (*UserSession) IsAdmin ¶ added in v1.1.1
func (us *UserSession) IsAdmin() bool
func (*UserSession) IsUserInRole ¶
func (us *UserSession) IsUserInRole(roles []role.Role) bool
Click to show internal directories.
Click to hide internal directories.