version2

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Distribution

type Distribution struct {
	Weight string
	Value  string
}

Distribution maps weight to a value in a SplitClient.

type InternalRedirectLocation

type InternalRedirectLocation struct {
	Path        string
	Destination string
}

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 Map

type Map struct {
	Source     string
	Variable   string
	Parameters []Parameter
}

Map defines a map.

type Parameter

type Parameter struct {
	Value  string
	Result string
}

Parameter defines a Parameter in a Map.

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

type UpstreamServer struct {
	Address     string
	MaxFails    int
	FailTimeout string
}

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.

Jump to

Keyboard shortcuts

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