nginx

package
v1.7.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const JWKSecretFileMode = 0644

JWKSecretFileMode defines the default filemode for files with JWK Secrets.

View Source
const TLSSecretFileMode = 0600

TLSSecretFileMode defines the default filemode for files with TLS Secrets.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeManager added in v1.5.0

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

FakeManager provides a fake implementation of the Manager interface.

func NewFakeManager added in v1.5.0

func NewFakeManager(confPath string) *FakeManager

NewFakeManager creates a FakeMananger.

func (*FakeManager) CreateConfig added in v1.5.0

func (*FakeManager) CreateConfig(name string, content []byte)

CreateConfig provides a fake implementation of CreateConfig.

func (*FakeManager) CreateDHParam added in v1.5.0

func (fm *FakeManager) CreateDHParam(content string) (string, error)

CreateDHParam provides a fake implementation of CreateDHParam.

func (*FakeManager) CreateMainConfig added in v1.5.0

func (*FakeManager) CreateMainConfig(content []byte)

CreateMainConfig provides a fake implementation of CreateMainConfig.

func (*FakeManager) CreateOpenTracingTracerConfig added in v1.6.0

func (*FakeManager) CreateOpenTracingTracerConfig(content string) error

CreateOpenTracingTracerConfig creates a fake implementation of CreateOpenTracingTracerConfig.

func (*FakeManager) CreateSecret added in v1.5.0

func (fm *FakeManager) CreateSecret(name string, content []byte, mode os.FileMode) string

CreateSecret provides a fake implementation of CreateSecret.

func (*FakeManager) CreateStreamConfig added in v1.7.0

func (*FakeManager) CreateStreamConfig(name string, content []byte)

CreateStreamConfig provides a fake implementation of CreateStreamConfig.

func (*FakeManager) CreateTLSPassthroughHostsConfig added in v1.7.0

func (*FakeManager) CreateTLSPassthroughHostsConfig(content []byte)

CreateTLSPassthroughHostsConfig provides a fake implementation of CreateTLSPassthroughHostsConfig.

func (*FakeManager) DeleteConfig added in v1.5.0

func (*FakeManager) DeleteConfig(name string)

DeleteConfig provides a fake implementation of DeleteConfig.

func (*FakeManager) DeleteSecret added in v1.5.0

func (*FakeManager) DeleteSecret(name string)

DeleteSecret provides a fake implementation of DeleteSecret.

func (*FakeManager) DeleteStreamConfig added in v1.7.0

func (*FakeManager) DeleteStreamConfig(name string)

DeleteStreamConfig provides a fake implementation of DeleteStreamConfig.

func (*FakeManager) GetFilenameForSecret added in v1.5.0

func (fm *FakeManager) GetFilenameForSecret(name string) string

GetFilenameForSecret provides a fake implementation of GetFilenameForSecret.

func (*FakeManager) Quit added in v1.5.0

func (*FakeManager) Quit()

Quit provides a fake implementation of Quit.

func (*FakeManager) Reload added in v1.5.0

func (*FakeManager) Reload() error

Reload provides a fake implementation of Reload.

func (*FakeManager) SetOpenTracing added in v1.6.0

func (*FakeManager) SetOpenTracing(openTracing bool)

SetOpenTracing creates a fake implementation of SetOpenTracing.

func (*FakeManager) SetPlusClients added in v1.5.0

func (*FakeManager) SetPlusClients(plusClient *client.NginxClient, plusConfigVersionCheckClient *http.Client)

SetPlusClients provides a fake implementation of SetPlusClients.

func (*FakeManager) Start added in v1.5.0

func (*FakeManager) Start(done chan error)

Start provides a fake implementation of Start.

func (*FakeManager) UpdateConfigVersionFile added in v1.5.0

func (*FakeManager) UpdateConfigVersionFile(openTracing bool)

UpdateConfigVersionFile provides a fake implementation of UpdateConfigVersionFile.

func (*FakeManager) UpdateServersInPlus added in v1.5.0

func (*FakeManager) UpdateServersInPlus(upstream string, servers []string, config ServerConfig) error

UpdateServersInPlus provides a fake implementation of UpdateServersInPlus.

func (*FakeManager) UpdateStreamServersInPlus added in v1.7.0

func (*FakeManager) UpdateStreamServersInPlus(upstream string, servers []string) error

UpdateStreamServersInPlus provides a fake implementation of UpdateStreamServersInPlus.

type LocalManager added in v1.5.0

type LocalManager struct {
	OpenTracing bool
	// contains filtered or unexported fields
}

LocalManager updates NGINX configuration, starts, reloads and quits NGINX, updates NGINX Plus upstream servers. It assumes that NGINX is running in the same container.

func NewLocalManager added in v1.5.0

func NewLocalManager(confPath string, binaryFilename string, mc collectors.ManagerCollector) *LocalManager

NewLocalManager creates a LocalManager.

func (*LocalManager) CreateConfig added in v1.5.0

func (lm *LocalManager) CreateConfig(name string, content []byte)

CreateConfig creates a configuration file. If the file already exists, it will be overridden.

func (*LocalManager) CreateDHParam added in v1.5.0

func (lm *LocalManager) CreateDHParam(content string) (string, error)

CreateDHParam creates the servers dhparam.pem file. If the file already exists, it will be overridden.

func (*LocalManager) CreateMainConfig added in v1.5.0

func (lm *LocalManager) CreateMainConfig(content []byte)

CreateMainConfig creates the main NGINX configuration file. If the file already exists, it will be overridden.

func (*LocalManager) CreateOpenTracingTracerConfig added in v1.6.0

func (lm *LocalManager) CreateOpenTracingTracerConfig(content string) error

CreateOpenTracingTracerConfig creates a json configuration file for the OpenTracing tracer with the content of the string.

func (*LocalManager) CreateSecret added in v1.5.0

func (lm *LocalManager) CreateSecret(name string, content []byte, mode os.FileMode) string

CreateSecret creates a secret file with the specified name, content and mode. If the file already exists, it will be overridden.

func (*LocalManager) CreateStreamConfig added in v1.7.0

func (lm *LocalManager) CreateStreamConfig(name string, content []byte)

CreateStreamConfig creates a configuration file for stream module. If the file already exists, it will be overridden.

func (*LocalManager) CreateTLSPassthroughHostsConfig added in v1.7.0

func (lm *LocalManager) CreateTLSPassthroughHostsConfig(content []byte)

CreateTLSPassthroughHostsConfig creates a configuration file with mapping between TLS Passthrough hosts and the corresponding unix sockets. If the file already exists, it will be overridden.

func (*LocalManager) DeleteConfig added in v1.5.0

func (lm *LocalManager) DeleteConfig(name string)

DeleteConfig deletes the configuration file from the conf.d folder.

func (*LocalManager) DeleteSecret added in v1.5.0

func (lm *LocalManager) DeleteSecret(name string)

DeleteSecret the file with the secret.

func (*LocalManager) DeleteStreamConfig added in v1.7.0

func (lm *LocalManager) DeleteStreamConfig(name string)

DeleteStreamConfig deletes the configuration file from the stream-conf.d folder.

func (*LocalManager) GetFilenameForSecret added in v1.5.0

func (lm *LocalManager) GetFilenameForSecret(name string) string

GetFilenameForSecret constructs the filename for the secret.

func (*LocalManager) Quit added in v1.5.0

func (lm *LocalManager) Quit()

Quit shutdowns NGINX gracefully.

func (*LocalManager) Reload added in v1.5.0

func (lm *LocalManager) Reload() error

Reload reloads NGINX.

func (*LocalManager) SetOpenTracing added in v1.6.0

func (lm *LocalManager) SetOpenTracing(openTracing bool)

SetOpenTracing sets the value of OpenTracing for the Manager

func (*LocalManager) SetPlusClients added in v1.5.0

func (lm *LocalManager) SetPlusClients(plusClient *client.NginxClient, plusConfigVersionCheckClient *http.Client)

SetPlusClients sets the necessary clients to work with NGINX Plus API. If not set, invoking the UpdateServersInPlus will fail.

func (*LocalManager) Start added in v1.5.0

func (lm *LocalManager) Start(done chan error)

Start starts NGINX.

func (*LocalManager) UpdateConfigVersionFile added in v1.5.0

func (lm *LocalManager) UpdateConfigVersionFile(openTracing bool)

UpdateConfigVersionFile writes the config version file.

func (*LocalManager) UpdateServersInPlus added in v1.5.0

func (lm *LocalManager) UpdateServersInPlus(upstream string, servers []string, config ServerConfig) error

UpdateServersInPlus updates NGINX Plus servers of the given upstream.

func (*LocalManager) UpdateStreamServersInPlus added in v1.7.0

func (lm *LocalManager) UpdateStreamServersInPlus(upstream string, servers []string) error

UpdateStreamServersInPlus updates NGINX Plus stream servers of the given upstream.

type Manager added in v1.5.0

type Manager interface {
	CreateMainConfig(content []byte)
	CreateConfig(name string, content []byte)
	DeleteConfig(name string)
	CreateStreamConfig(name string, content []byte)
	DeleteStreamConfig(name string)
	CreateTLSPassthroughHostsConfig(content []byte)
	CreateSecret(name string, content []byte, mode os.FileMode) string
	DeleteSecret(name string)
	GetFilenameForSecret(name string) string
	CreateDHParam(content string) (string, error)
	CreateOpenTracingTracerConfig(content string) error
	Start(done chan error)
	Reload() error
	Quit()
	UpdateConfigVersionFile(openTracing bool)
	SetPlusClients(plusClient *client.NginxClient, plusConfigVersionCheckClient *http.Client)
	UpdateServersInPlus(upstream string, servers []string, config ServerConfig) error
	UpdateStreamServersInPlus(upstream string, servers []string) error
	SetOpenTracing(openTracing bool)
}

The Manager interface updates NGINX configuration, starts, reloads and quits NGINX, updates NGINX Plus upstream servers.

type ServerConfig added in v1.5.0

type ServerConfig struct {
	MaxFails    int
	MaxConns    int
	FailTimeout string
	SlowStart   string
}

ServerConfig holds the config data for an upstream server in NGINX Plus.

Jump to

Keyboard shortcuts

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