conf

package
v0.0.0-...-a382c62 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &config{
	System: system{
		Name:   "Anchor",
		Listen: ":8080",
		Debug:  false,
	},
	Proxy: proxy{
		Github: githubProxy{
			Open:      false,
			Minify:    MinifyOnlyMin,
			Endpoint:  []string{"https://raw.githubusercontent.com/{{user}}/{{repo}}/{{version}}/{{path}}"},
			WhiteList: nil,
		},
		Npm: npmProxy{
			Open:      false,
			Minify:    MinifyOnlyMin,
			Endpoint:  []string{"https://unpkg.com/{{package}}@{{version}}/{{path}}"},
			WhiteList: nil,
		},
		Wp: wordpressProxy{
			PluginOpen:      false,
			ThemeOpen:       false,
			Minify:          MinifyNone,
			PluginWhiteList: nil,
			ThemeWhiteList:  nil,
		},
	},
	CORS: cors{
		AllowOrigins:     []string{"UNSET"},
		AllowMethods:     []string{"GET", "HEAD", "OPTIONS"},
		AllowHeaders:     []string{"Content-Length", "Content-Type", "X-Powered-By", "X-Run-By", "X-Timestamp"},
		AllowCredentials: false,
		ExposeHeaders:    nil,
	},
}

Functions

func Init

func Init(path string)

Types

type MinifyType

type MinifyType string
const (
	MinifyAll     MinifyType = "all"     // MinifyAll 压缩所有可压缩文件
	MinifyOnlyMin MinifyType = "onlyMin" // MinifyOnlyMin 仅压缩 .min.* 结尾的文件
	MinifyNone    MinifyType = "none"    // MinifyNone 不压缩文件
)

Jump to

Keyboard shortcuts

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