Documentation
¶
Index ¶
Constants ¶
const (
// HeaderMatchSeparator is the separator for constructing header-based match for NJS.
HeaderMatchSeparator = ":"
)
Variables ¶
var ConfigFolders = []string{httpFolder, secretsFolder, includesFolder, mainIncludesFolder, streamFolder}
ConfigFolders is a list of folders where NGINX configuration files are stored. Volumes here also need to be added to our crossplane ephemeral test container.
Functions ¶
func ConvertEndpoints ¶
func ConvertEndpoints(eps []resolver.Endpoint) []ngxclient.UpstreamServer
ConvertEndpoints converts a list of Endpoints into a list of NGINX Plus SDK UpstreamServers.
func ConvertStreamEndpoints ¶
func ConvertStreamEndpoints(eps []resolver.Endpoint) []ngxclient.StreamUpstreamServer
ConvertStreamEndpoints converts a list of Endpoints into a list of NGINX Plus SDK StreamUpstreamServers.
Types ¶
type Generator ¶
type Generator interface { // Generate generates NGINX configuration files from internal representation. Generate(configuration dataplane.Configuration) []file.File // GenerateDeploymentContext generates the deployment context used for N+ licensing. GenerateDeploymentContext(depCtx dataplane.DeploymentContext) (file.File, error) }
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 folders above, which must exist and available for writing.
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 other folders.
func NewGeneratorImpl ¶
func NewGeneratorImpl( plus bool, usageReportConfig *ngfConfig.UsageReportConfig, logger logr.Logger, ) 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.
func (GeneratorImpl) GenerateDeploymentContext ¶
func (g GeneratorImpl) GenerateDeploymentContext(depCtx dataplane.DeploymentContext) (file.File, error)
GenerateDeploymentContext generates the deployment_ctx.json file needed for N+ licensing. It's exported since it's used by the init container process.
Source Files
¶
- base_http_config.go
- base_http_config_template.go
- convert.go
- generator.go
- includes.go
- main_config.go
- main_config_template.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. |