nginx

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 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) 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) 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) 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) 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()

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.

type LocalManager added in v1.5.0

type LocalManager struct {
	// 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) 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) 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) 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) 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()

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.

type Manager added in v1.5.0

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

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
	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