common

package
v0.0.0-...-6840d49 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext(args *CustomContext, next http.Handler) http.Handler

CreateContext middleware attaches the CustomContext to each request

func InitDb

func InitDb() (*gorm.DB, error)

Types

type CustomContext

type CustomContext struct {
	Database *gorm.DB
}

CustomContext struct holds the database connection

func GetContext

func GetContext(ctx context.Context) *CustomContext

GetContext retrieves the CustomContext from the request context

Jump to

Keyboard shortcuts

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