version2

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 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 ErrorPage added in v1.7.0

type ErrorPage struct {
	Name         string
	Codes        string
	ResponseCode int
}

ErrorPage defines an error_page of a location.

type ErrorPageLocation added in v1.7.0

type ErrorPageLocation struct {
	Name        string
	DefaultType string
	Return      *Return
	Headers     []Header
}

ErrorPageLocation defines a named location for an error_page directive.

type Header struct {
	Name  string
	Value string
}

Header defines a header to use with add_header directive.

type HealthCheck added in v1.6.0

type HealthCheck struct {
	Name                string
	URI                 string
	Interval            string
	Jitter              string
	Fails               int
	Passes              int
	Port                int
	ProxyPass           string
	ProxyConnectTimeout string
	ProxyReadTimeout    string
	ProxySendTimeout    string
	Headers             map[string]string
	Match               string
}

HealthCheck defines a HealthCheck for an upstream in a Server.

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
	Internal                 bool
	Snippets                 []string
	ProxyConnectTimeout      string
	ProxyReadTimeout         string
	ProxySendTimeout         string
	ClientMaxBodySize        string
	ProxyMaxTempFileSize     string
	ProxyBuffering           bool
	ProxyBuffers             string
	ProxyBufferSize          string
	ProxyPass                string
	ProxyNextUpstream        string
	ProxyNextUpstreamTimeout string
	ProxyNextUpstreamTries   int
	ProxyInterceptErrors     bool
	HasKeepalive             bool
	DefaultType              string
	Return                   *Return
	ErrorPages               []ErrorPage
	ProxySSLName             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 Queue added in v1.6.0

type Queue struct {
	Size    int
	Timeout string
}

Queue defines a queue in upstream.

type Return added in v1.6.0

type Return struct {
	Code int
	Text string
}

Return defines a Return directive used for redirects and canned responses.

type SSL

type SSL struct {
	HTTP2          bool
	Certificate    string
	CertificateKey string
	Ciphers        string
}

SSL defines SSL configuration for a server.

type Server

type Server struct {
	ServerName                string
	StatusZone                string
	ProxyProtocol             bool
	SSL                       *SSL
	ServerTokens              string
	RealIPHeader              string
	SetRealIPFrom             []string
	RealIPRecursive           bool
	Snippets                  []string
	InternalRedirectLocations []InternalRedirectLocation
	Locations                 []Location
	ErrorPageLocations        []ErrorPageLocation
	HealthChecks              []HealthCheck
	TLSRedirect               *TLSRedirect
	TLSPassthrough            bool
}

Server defines a server.

type SessionCookie added in v1.6.0

type SessionCookie struct {
	Enable   bool
	Name     string
	Path     string
	Expires  string
	Domain   string
	HTTPOnly bool
	Secure   bool
}

SessionCookie defines a session cookie for an upstream.

type SplitClient

type SplitClient struct {
	Source        string
	Variable      string
	Distributions []Distribution
}

SplitClient defines a split_clients.

type StatusMatch added in v1.6.0

type StatusMatch struct {
	Name string
	Code string
}

StatusMatch defines a Match block for status codes.

type StreamServer added in v1.7.0

type StreamServer struct {
	TLSPassthrough bool
	UnixSocket     string
	Port           int
	UDP            bool
	StatusZone     string
	ProxyRequests  *int
	ProxyResponses *int
	ProxyPass      string
}

StreamServer defines a server in the stream module.

type StreamUpstream added in v1.7.0

type StreamUpstream struct {
	Name    string
	Servers []StreamUpstreamServer
}

StreamUpstream defines a stream upstream.

type StreamUpstreamServer added in v1.7.0

type StreamUpstreamServer struct {
	Address string
}

StreamUpstreamServer defines a stream upstream server.

type TLSPassthroughHostsConfig added in v1.7.0

type TLSPassthroughHostsConfig map[string]string

TLSPassthroughHostsConfig defines a mapping between TLS Passthrough hosts and the corresponding unix sockets.

type TLSRedirect added in v1.6.0

type TLSRedirect struct {
	Code    int
	BasedOn string
}

TLSRedirect defines a redirect in a Server.

type TemplateExecutor

type TemplateExecutor struct {
	// contains filtered or unexported fields
}

TemplateExecutor executes NGINX configuration templates.

func NewTemplateExecutor

func NewTemplateExecutor(virtualServerTemplatePath string, transportServerTemplatePath string) (*TemplateExecutor, error)

NewTemplateExecutor creates a TemplateExecutor.

func (*TemplateExecutor) ExecuteTLSPassthroughHostsTemplate added in v1.7.0

func (te *TemplateExecutor) ExecuteTLSPassthroughHostsTemplate(cfg *TLSPassthroughHostsConfig) ([]byte, error)

ExecuteTLSPassthroughHostsTemplate generates the content of an NGINX configuration file for mapping between TLS Passthrough hosts and the corresponding unix sockets.

func (*TemplateExecutor) ExecuteTransportServerTemplate added in v1.7.0

func (te *TemplateExecutor) ExecuteTransportServerTemplate(cfg *TransportServerConfig) ([]byte, error)

ExecuteTransportServerTemplate generates the content of an NGINX configuration file for a TransportServer resource.

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 TransportServerConfig added in v1.7.0

type TransportServerConfig struct {
	Server    StreamServer
	Upstreams []StreamUpstream
}

TransportServerConfig holds NGINX configuration for a TransportServer.

type Upstream

type Upstream struct {
	Name             string
	Servers          []UpstreamServer
	LBMethod         string
	Resolve          bool
	Keepalive        int
	MaxFails         int
	MaxConns         int
	SlowStart        string
	FailTimeout      string
	UpstreamZoneSize string
	Queue            *Queue
	SessionCookie    *SessionCookie
}

Upstream defines an upstream.

type UpstreamServer

type UpstreamServer struct {
	Address string
}

UpstreamServer defines an upstream server.

type VirtualServerConfig

type VirtualServerConfig struct {
	Server        Server
	Upstreams     []Upstream
	SplitClients  []SplitClient
	Maps          []Map
	StatusMatches []StatusMatch
	SpiffeCerts   bool
}

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