Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Distribution ¶
Distribution maps weight to a value in a SplitClient.
type InternalRedirectLocation ¶
InternalRedirectLocation defines a location for internally redirecting requests to named locations.
type Location ¶
type Location struct { Path string Snippets []string ProxyConnectTimeout string ProxyReadTimeout string ClientMaxBodySize string ProxyMaxTempFileSize string ProxyBuffering bool ProxyBuffers string ProxyBufferSize string ProxyPass string }
Location defines a location.
type SSL ¶
type SSL struct { HTTP2 bool Certificate string CertificateKey string Ciphers string RedirectToHTTPS bool }
SSL defines SSL configuration for a server.
type Server ¶
type Server struct { ServerName string ProxyProtocol bool SSL *SSL RedirectToHTTPSBasedOnXForwarderProto bool ServerTokens string RealIPHeader string SetRealIPFrom []string RealIPRecursive bool Snippets []string InternalRedirectLocations []InternalRedirectLocation Locations []Location }
Server defines a server.
type SplitClient ¶
type SplitClient struct { Source string Variable string Distributions []Distribution }
SplitClient defines a split_clients.
type TemplateExecutor ¶
type TemplateExecutor struct {
// contains filtered or unexported fields
}
TemplateExecutor executes NGINX configuration templates.
func NewTemplateExecutor ¶
func NewTemplateExecutor(virtualServerTemplatePath string) (*TemplateExecutor, error)
NewTemplateExecutor creates a TemplateExecutor.
func (*TemplateExecutor) ExecuteVirtualServerTemplate ¶
func (te *TemplateExecutor) ExecuteVirtualServerTemplate(cfg *VirtualServerConfig) ([]byte, error)
ExecuteVirtualServerTemplate generates the content of an NGINX configuration file for a VirtualServer resource.
type Upstream ¶
type Upstream struct { Name string Servers []UpstreamServer LBMethod string }
Upstream defines an upstream.
type UpstreamServer ¶
UpstreamServer defines an upstream server.
type VirtualServerConfig ¶
type VirtualServerConfig struct { Server Server Upstreams []Upstream SplitClients []SplitClient Maps []Map Keepalive string }
VirtualServerConfig holds NGINX configuration for a VirtualServer.