Documentation ¶
Index ¶
Constants ¶
const (
// HeaderMatchSeparator is the separator for constructing header-based match for NJS.
HeaderMatchSeparator = ":"
)
Variables ¶
var ConfigFolders = []string{httpFolder, secretsFolder, includesFolder, modulesIncludesFolder, streamFolder}
ConfigFolders is a list of folders where NGINX configuration files are stored.
Functions ¶
func ConvertEndpoints ¶ added in v1.2.0
func ConvertEndpoints(eps []resolver.Endpoint) []ngxclient.UpstreamServer
ConvertEndpoints converts a list of Endpoints into a list of NGINX Plus SDK UpstreamServers.
Types ¶
type Generator ¶
type Generator interface { // Generate generates NGINX configuration files from internal representation. Generate(configuration dataplane.Configuration) []file.File }
Generator generates NGINX configuration files. This interface is used for testing purposes only.
type GeneratorImpl ¶
type GeneratorImpl struct {
// contains filtered or unexported fields
}
GeneratorImpl is an implementation of Generator.
It generates files to be written to the following locations, which must exist and available for writing: - httpFolder, for HTTP configuration files. - secretsFolder, for secrets.
It also expects that the main NGINX configuration file nginx.conf is located in configFolder and nginx.conf includes (https://nginx.org/en/docs/ngx_core_module.html#include) the files from httpFolder.
func NewGeneratorImpl ¶
func NewGeneratorImpl(plus bool) GeneratorImpl
NewGeneratorImpl creates a new GeneratorImpl.
func (GeneratorImpl) Generate ¶
func (g GeneratorImpl) Generate(conf dataplane.Configuration) []file.File
Generate generates NGINX configuration files from internal representation. It is the responsibility of the caller to validate the configuration before calling this function. In case of invalid configuration, NGINX will fail to reload or could be configured with malicious configuration. To validate, use the validators from the validation package.
Source Files ¶
- base_http_config.go
- base_http_config_template.go
- convert.go
- generator.go
- maps.go
- maps_template.go
- servers.go
- servers_template.go
- sockets.go
- split_clients.go
- split_clients_template.go
- stream_servers.go
- stream_servers_template.go
- telemetry.go
- telemetry_template.go
- upstreams.go
- upstreams_template.go
- variable_names.go
- version.go
- version_template.go
Directories ¶
Path | Synopsis |
---|---|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
policiesfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Package validation includes validators to validate values that will propagate to the NGINX configuration.
|
Package validation includes validators to validate values that will propagate to the NGINX configuration. |