core

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CORSConfig = cors.Config{
	AllowOrigins:     []string{"https://foo.com"},
	AllowMethods:     []string{"PUT", "PATCH"},
	AllowHeaders:     []string{"Origin"},
	ExposeHeaders:    []string{"Content-Length"},
	AllowCredentials: true,
	AllowOriginFunc: func(origin string) bool {
		return origin == "https://github.com"
	},
}

Middleware config

View Source
var DATABASE *gorm.DB
View Source
var DATABASE_URL string = "DB_URL"

Functions

func GetDB

func GetDB() *gorm.DB

func GlobalMiddlewareInit

func GlobalMiddlewareInit(router *gin.Engine)

Global midleware settings (for all APIs)

func MiddlewareInit

func MiddlewareInit(router *gin.Engine)

Custom midleware settings (for specific API)

Types

This section is empty.

Jump to

Keyboard shortcuts

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