Documentation ¶
Index ¶
- Constants
- type FakeManager
- func (*FakeManager) CreateConfig(name string, content []byte)
- func (fm *FakeManager) CreateDHParam(content string) (string, error)
- func (*FakeManager) CreateMainConfig(content []byte)
- func (*FakeManager) CreateOpenTracingTracerConfig(content string) error
- func (fm *FakeManager) CreateSecret(name string, content []byte, mode os.FileMode) string
- func (*FakeManager) DeleteConfig(name string)
- func (*FakeManager) DeleteSecret(name string)
- func (fm *FakeManager) GetFilenameForSecret(name string) string
- func (*FakeManager) Quit()
- func (*FakeManager) Reload() error
- func (*FakeManager) SetOpenTracing(openTracing bool)
- func (*FakeManager) SetPlusClients(plusClient *client.NginxClient, plusConfigVersionCheckClient *http.Client)
- func (*FakeManager) Start(done chan error)
- func (*FakeManager) UpdateConfigVersionFile(openTracing bool)
- func (*FakeManager) UpdateServersInPlus(upstream string, servers []string, config ServerConfig) error
- type LocalManager
- func (lm *LocalManager) CreateConfig(name string, content []byte)
- func (lm *LocalManager) CreateDHParam(content string) (string, error)
- func (lm *LocalManager) CreateMainConfig(content []byte)
- func (lm *LocalManager) CreateOpenTracingTracerConfig(content string) error
- func (lm *LocalManager) CreateSecret(name string, content []byte, mode os.FileMode) string
- func (lm *LocalManager) DeleteConfig(name string)
- func (lm *LocalManager) DeleteSecret(name string)
- func (lm *LocalManager) GetFilenameForSecret(name string) string
- func (lm *LocalManager) Quit()
- func (lm *LocalManager) Reload() error
- func (lm *LocalManager) SetOpenTracing(openTracing bool)
- func (lm *LocalManager) SetPlusClients(plusClient *client.NginxClient, plusConfigVersionCheckClient *http.Client)
- func (lm *LocalManager) Start(done chan error)
- func (lm *LocalManager) UpdateConfigVersionFile(openTracing bool)
- func (lm *LocalManager) UpdateServersInPlus(upstream string, servers []string, config ServerConfig) error
- type Manager
- type ServerConfig
Constants ¶
const JWKSecretFileMode = 0644
JWKSecretFileMode defines the default filemode for files with JWK Secrets.
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
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) 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.
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
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) 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.
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) 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 SetOpenTracing(openTracing bool) }
The Manager interface updates NGINX configuration, starts, reloads and quits NGINX, updates NGINX Plus upstream servers.