common

package
v0.0.0-...-4fa15db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthWithBasic

func AuthWithBasic(c *gin.Context, bs64Token string) error

func AuthWithJWT

func AuthWithJWT(c *gin.Context, token string) error

func AuthWithPrivateToken

func AuthWithPrivateToken(c *gin.Context, token string) error

func AuthWithSession

func AuthWithSession(c *gin.Context) (err error)

func DeleteUserSession

func DeleteUserSession(c *gin.Context) error

func GetRepoImageForUpload

func GetRepoImageForUpload(c *gin.Context, imgUser, name, tag string) (repo *models.Repository, img *models.Image, err error)

func LoginUser

func LoginUser(c *gin.Context) (user *models.User, exists bool)

func SaveUserSession

func SaveUserSession(c *gin.Context, u *models.User) error

Types

type JWT

type JWT struct {
	SigningKey []byte
}

func NewJWT

func NewJWT(key string) *JWT

func (*JWT) CreateToken

func (j *JWT) CreateToken(claims models.CustomClaims) (string, error)

CreateToken create token

func (*JWT) ParseToken

func (j *JWT) ParseToken(tokenString string) (*models.CustomClaims, error)

ParseToken parse token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL