Documentation ¶
Index ¶
- func ClearTokens(client *ent.Client, ctx context.Context)
- func ForContext(ctx context.Context) (*ent.User, error)
- func ForContextIp(ctx *gin.Context) (string, error)
- func Middleware(client *ent.Client) gin.HandlerFunc
- func ReturnError(ctx *gin.Context, code int, message string, err error)
- func ServiceMiddleware(client *ent.Client) gin.HandlerFunc
- func UnauthenticatedMiddleware() gin.HandlerFunc
- type APIError
- type CompsoleJWTClaims
- type ServiceAccountHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTokens ¶
ClearTokens Clears Old tokens from DB
func ForContext ¶
ForContext finds the user from the context. REQUIRES Middleware to have run.
func Middleware ¶
func Middleware(client *ent.Client) gin.HandlerFunc
Middleware decodes the share session cookie and packs the session into context
func ServiceMiddleware ¶
func ServiceMiddleware(client *ent.Client) gin.HandlerFunc
func UnauthenticatedMiddleware ¶
func UnauthenticatedMiddleware() gin.HandlerFunc
Types ¶
type CompsoleJWTClaims ¶
CompsoleJWTClaims Create a struct that will be encoded to a JWT.
type ServiceAccountHeader ¶
type ServiceAccountHeader struct {
Authorization *string `header:"Authorization" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.