ginctx

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// timestamp of the request
	TIMESTAMP_KEY = "timestamp"

	// JWT validation parameters
	JWT_TOKEN_KEY         = "jwt-token"
	JWT_CLAIMS_KEY        = "jwt-claims"
	JWT_KEYFUNC_KEY       = "jwt-keyfunc"
	JWT_PARSE_OPTIONS_KEY = "jwt-parse-options"

	SERVER_JWT_SECRET_KEY = "server-jwt-secret"

	// JWT issue parameters
	JWT_SIGNING_METHOD = "jwt-signing-method"

	// Gorm connection
	GORM_CONNECTION_KEY = "gorm-connection"

	// Repo object
	REPO_KEY = "repo"

	// S3 connection
	S3_CONNECTION_KEY          = "s3-connection"
	S3_INTERNAL_CONNECTION_KEY = "s3-internal-connection"

	// Caller
	CALLER_KEY = "caller"
)

Variables

This section is empty.

Functions

func Get

func Get[T any](c *gin.Context, key string) (T, error)

func GetAtomic

func GetAtomic[T any](c *gin.Context, key string) (T, error)

func GetAtomicOrNormal

func GetAtomicOrNormal[T any](c *gin.Context, key string) (T, error)

func GetAuthorization

func GetAuthorization(c *gin.Context, key string) (string, error)

func GetDB

func GetDB(c *gin.Context, key string) (*gorm.DB, error)

func GetDto

func GetDto[T any](c *gin.Context) (T, error)

func GetDuration

func GetDuration(c *gin.Context, key string) (time.Duration, error)

func GetJwt

func GetJwt(c *gin.Context, key string) (*jwt.Token, error)

func GetMedia

func GetMedia(c *gin.Context, key string) (*utils.MediaValidity, error)

func GetOAuth2Token

func GetOAuth2Token(c *gin.Context, key string) (*oauth2.Token, error)

func GetPresignedUrl

func GetPresignedUrl(c *gin.Context, key string) (*s3.PresignedPostRequest, error)

func GetRepo

func GetRepo(c *gin.Context, key string) (*repositories.Repo, error)

func GetS3

func GetS3(c *gin.Context, key string) (*s3.Client, error)

func GetS3EventObj

func GetS3EventObj(c *gin.Context, key string) ([]utils.S3Object, error)

func GetServerJwtSecret

func GetServerJwtSecret(c *gin.Context) (any, error)

func GetSigningMethod

func GetSigningMethod(c *gin.Context, key string) (jwt.SigningMethod, error)

func GetTimestamp

func GetTimestamp(c *gin.Context) (time.Time, error)

func GetTx

func GetTx(c *gin.Context, key string) (*gorm.DB, error)

func GetUUID

func GetUUID(c *gin.Context, key string) (uuid.UUID, error)

func ShouldBindJSON

func ShouldBindJSON[T any](c *gin.Context)

Binders

func ShouldBindQuery

func ShouldBindQuery[T any](c *gin.Context)

func UseAtomic

func UseAtomic(r gin.IRoutes, key string, atom *atomic.Value) gin.IRoutes

func UseEnvJwtSecret

func UseEnvJwtSecret(r gin.IRoutes) gin.IRoutes

func UseRepo

func UseRepo(r gin.IRouter)

func UseS3

func UseS3(r gin.IRoutes, client *s3.Client, internal *s3.Client) gin.IRoutes

func UseTimestamp

func UseTimestamp(r gin.IRoutes) gin.IRoutes

func UseTx

func UseTx(r gin.IRoutes, db *gorm.DB) gin.IRoutes

Types

This section is empty.

Jump to

Keyboard shortcuts

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