config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderMatchSeparator is the separator for constructing header-based match for NJS.
	HeaderMatchSeparator = ":"
)

Variables

View Source
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.

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.

Jump to

Keyboard shortcuts

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