corsmiddleware

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProviderProductionSet provides CORSMiddleware for use in production.
	ProviderProductionSet = wire.NewSet(Provide, Cfg)
)

Functions

func Cfg

func Cfg(v *viper.Viper) (*cors.Config, error)

Cfg provides a Config using values obtained from a Viper instance.

Types

type CORSMiddleware

type CORSMiddleware struct {
	Config cors.Config
}

CORSMiddleware serves as middleware to specify CORS settings.

func Provide

func Provide(cfg *cors.Config) *CORSMiddleware

Provide returns the CORSMiddleware configured with the provided Config.

func (*CORSMiddleware) HandleCORS

func (c *CORSMiddleware) HandleCORS() gin.HandlerFunc

HandleCORS provides the HandlerFunc to apply CORS settings to requests.

Jump to

Keyboard shortcuts

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