Documentation ¶
Index ¶
- Constants
- func DecodeRedirectState(state string) (string, error)
- func EncodeRedirectState(state []byte) string
- func EncodeUrlAndQuery(url *url.URL) string
- func JsonDecode(data string, result interface{}) error
- func JsonEncode(data interface{}) (string, error)
- func OAuth2ParseAuthorizationRequest(request *gin.Context) auth.OAuth2AuthRequest
- func ToBase64Url(bytes []byte) string
- type Controller
- type ControllerContext
- type ErrorPageParams
- type Tools
- func (tool *Tools) EncodeCurrentUrl(ctx context.Context) string
- func (tool *Tools) ErrorPage(ctx context.Context, params ErrorPageParams)
- func (tool *Tools) ExtractJwt(ctx context.Context) (jwtlib.Jwt, error)
- func (tool *Tools) Fail(ctx context.Context, err api_errors.ApiError)
- func (tool *Tools) GetCurrentApp(ctx context.Context) (*apps.Application, error)
- func (tool *Tools) GetCurrentUserAndApp(ctx context.Context) (dto *users.UserDTO, appDTO *apps.AppDTO, err error)
- func (tool *Tools) GetIdentity(ctx context.Context) *auth.LoginIdentity
- func (tool *Tools) GetLoggedInUser(ctx context.Context) *users.UserDTO
- func (tool *Tools) GetRedirectState(ctx context.Context) string
- func (tool *Tools) Gin(ctx context.Context) *gin.Context
- func (tool *Tools) HTML(ctx context.Context, code int, template string, params gin.H)
- func (tool *Tools) JSON(ctx context.Context, code int, obj interface{})
- func (tool *Tools) NewControllerContext(gin *gin.Context) context.Context
- func (tool *Tools) Param(ctx context.Context, key string) string
- func (tool *Tools) Redirect(ctx context.Context, url string)
- func (tool *Tools) RedirectToLogin(ctx context.Context)
- func (tool *Tools) RedirectWithRedirectState(ctx context.Context, defaultRedirect string) error
- func (tool *Tools) WriteErr(ctx context.Context, err error)
Constants ¶
View Source
const CookieAccessToken = "JWT_ACCESS"
View Source
const CookieRefreshToken = "JWT_REFRESH"
View Source
const CookieSessionToken = "JWT_SESSION"
Variables ¶
This section is empty.
Functions ¶
func DecodeRedirectState ¶
func EncodeRedirectState ¶
func EncodeUrlAndQuery ¶
func JsonDecode ¶
func JsonEncode ¶
func OAuth2ParseAuthorizationRequest ¶
func OAuth2ParseAuthorizationRequest(request *gin.Context) auth.OAuth2AuthRequest
func ToBase64Url ¶
Types ¶
type Controller ¶
type Controller interface {
RegisterRoutes(router *gin.RouterGroup)
}
type ErrorPageParams ¶
type Tools ¶
func NewHTTPTools ¶
func (*Tools) GetCurrentApp ¶
func (*Tools) GetCurrentUserAndApp ¶
func (*Tools) GetIdentity ¶
func (tool *Tools) GetIdentity(ctx context.Context) *auth.LoginIdentity
func (*Tools) GetLoggedInUser ¶
func (*Tools) NewControllerContext ¶
func (*Tools) RedirectToLogin ¶
func (*Tools) RedirectWithRedirectState ¶
Click to show internal directories.
Click to hide internal directories.