cors

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "cors"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	ioc.ObjectImpl

	Enabled        bool     `toml:"enabled" json:"enabled" yaml:"enabled"  env:"HTTP_CORS_ENABLED"`
	AllowedHeaders []string `` /* 132-byte string literal not displayed */
	AllowedDomains []string `` /* 132-byte string literal not displayed */
	AllowedMethods []string `` /* 132-byte string literal not displayed */
	ExposeHeaders  []string `` /* 128-byte string literal not displayed */
	AllowCookies   bool     `toml:"cors_allow_cookies" json:"cors_allow_cookies" yaml:"cors_allow_cookies"  env:"HTTP_CORS_ALLOW_COOKIES"`
	// 单位秒, 默认12小时
	MaxAge int `toml:"max_age" json:"max_age" yaml:"max_age"  env:"HTTP_CORS_MAX_AGE"`
	// contains filtered or unexported fields
}

func Get

func Get() *CORS

func (*CORS) Init

func (m *CORS) Init() error

func (*CORS) Name

func (m *CORS) Name() string

func (*CORS) Priority

func (i *CORS) Priority() int

Jump to

Keyboard shortcuts

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