define

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrameName      = "CHAN"
	DateTimeLayout = "2006-01-02 15:04:05"
	Version        = "chan/0.1.1"
	ProcessName    = ".chan.lock"
)

Variables

View Source
var DefaultChanConf = ChanConf{
	Server: []Server{
		{
			Listen:     ":80",
			ServerName: "localhost",
		},
	},
}
View Source
var (
	DefaultWeight = 1 // 默认权重
)

Functions

This section is empty.

Types

type ChanConf

type ChanConf struct {
	Server []Server `json:"server"`
}

type ChanProcess

type ChanProcess struct {
	Pid  int    `json:"pid"`  // 程序ID
	Conf string `json:"conf"` // 配置文件路径
}

type Server

type Server struct {
	Listen     string `json:"listen"`      // 监听地址
	ServerName string `json:"server_name"` // 域名
	SslCert    string `json:"ssl_cert"`    // ssl 证书
	SslKey     string `json:"ssl_key"`     // ssl key
	Upstream   *struct {
		Name    string `json:"name"` // 变量名称
		Counter int    `json:"-"`    // 计数器
		Weights int    `json:"-"`    // 权重总和
		Values  []struct {
			Value  string `json:"value"`  // 值
			Weight int    `json:"weight"` // 权重,默认为 1
		} `json:"values"` // 变量的值
	} `json:"upstream"` // 上游配置
	Location []struct {
		Path      string   `json:"path"`       // 父级路由地址
		Index     []string `json:"index"`      // 首页包含的地址
		Root      string   `json:"root"`       // 静态资源文件地址
		ProxyPass string   `json:"proxy_pass"` // 反向代理地址,与静态代理互斥,同时配置时只有一种生效
	} `json:"location"` // 请求地址
}

Jump to

Keyboard shortcuts

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