Documentation ¶
Index ¶
Constants ¶
const ( // DirectiveInclude is the include directive. DirectiveInclude = "include" // DirectiveHTTP is the http directive. DirectiveHTTP = "http" // DirectiveServer is the server directive. DirectiveServer = "server" // DirectiveLocation is the location directive. DirectiveLocation = "location" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackendInfo ¶
BackendInfo is the config for backend.
type Config ¶
type Config struct {
Servers []*Server `json:"servers"`
}
Config is config for convert.
type Env ¶
type Env struct { Server *ServerEnv `json:"server"` Proxy *ProxyEnv `json:"proxy"` Upstream []*Directive `json:"upstream"` // contains filtered or unexported fields }
Env is the environment for converting. Server is the server environment. Used to create HTTPServer or in future GRPCServer. Proxy is the proxy environment. Used to create Pipeline.
func (*Env) GetProxyInfo ¶
GetProxyInfo gets the proxy info from environment.
func (*Env) GetServerInfo ¶
func (env *Env) GetServerInfo() (*ServerInfo, error)
GetServerInfo gets the server info from environment.
type GzipEnv ¶
type GzipEnv struct { Gzip *Directive `json:"gzip"` GzipMinLength *Directive `json:"gzip_min_length"` }
GzipEnv is the environment for creating gzip.
type Options ¶
type Options struct { NginxConf string Output string ResourcePrefix string // contains filtered or unexported fields }
Options contains the options for convert nginx.conf.
func (*Options) GetPipelineName ¶
GetPipelineName creates a globally unique name for the pipeline based on the path.
type Path ¶
type Path struct { Path string `json:"path"` Type PathType `json:"type"` Backend *ProxyInfo `json:"backend"` }
Path is the config for path.
type PathType ¶
type PathType string
PathType is the type of path.
const ( // PathTypePrefix is the prefix type of path. PathTypePrefix PathType = "prefix" // PathTypeExact is the exact type of path. PathTypeExact PathType = "exact" // PathTypeRe is the regexp type of path. PathTypeRe PathType = "regexp" // PathTypeReInsensitive is the case insensitive regexp type of path. PathTypeReInsensitive PathType = "caseInsensitiveRegexp" )
type ProxyEnv ¶
type ProxyEnv struct { Pass *Directive `json:"pass"` ProxySetHeader []*Directive `json:"proxy_set_header"` Gzip *GzipEnv `json:"gzip"` }
ProxyEnv is the environment for creating proxy.
type ProxyInfo ¶
type ProxyInfo struct { Servers []*BackendInfo `json:"servers"` SetHeaders map[string]string `json:"setHeaders"` GzipMinLength int `json:"gzipMinLength"` }
ProxyInfo is the config for proxy.
type Server ¶
type Server struct { ServerBase `json:",inline"` Rules []*Rule `json:"rules"` }
Server is the config for server.
type ServerBase ¶
type ServerBase struct { Port int `json:"port"` Address string `json:"address"` HTTPS bool `json:"https"` CaCert string `json:"caCert"` Certs map[string]string `json:"certs"` Keys map[string]string `json:"keys"` }
ServerBase is the base config for server.
type ServerEnv ¶
type ServerEnv struct { Listen *Directive `json:"listen"` ServerName *Directive `json:"server_name"` SSLClientCertificate *Directive `json:"ssl_client_certificate"` SSLCertificate []*Directive `json:"ssl_certificate"` SSLCertificateKey []*Directive `json:"ssl_certificate_key"` }
ServerEnv is the environment for creating server. Listen contains the listen address, port and protocol. ServerName contains the server name (hosts in easegress).
type ServerInfo ¶
type ServerInfo struct { ServerBase `json:",inline"` Hosts []*HostInfo `json:"hosts"` }
ServerInfo is the info config for server.