parser

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const FilePerm = 0644

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	SocketAddress SocketAddress `yaml:"socket_address,omitempty"`
}

type BaseTemplate

type BaseTemplate struct {
	UpstreamAddress string
	UpstreamPort    string
	ListenerPort    string
	Name            string
	Key             string
	Cert            string
	TrustedCA       string
	MTLS            bool
	Ciphers         string
}

type CertChain

type CertChain struct {
	InlineString string `yaml:"inline_string,omitempty"`
}

type Cluster

type Cluster struct {
	Hosts []Host `yaml:"hosts,omitempty"`
	Name  string `yaml:"name,omitempty"`
}

type CommonTLSContext added in v0.6.0

type CommonTLSContext struct {
	TLSParams TLSParams `yaml:"tls_params,omitempty"`
}

type Config

type Config struct {
	Cluster string `yaml:"cluster,omitempty"`
}

type EnvoyConf

type EnvoyConf struct {
	StaticResources StaticResources `yaml:"static_resources,omitempty"`
}

type EnvoyConfParser

type EnvoyConfParser struct{}

func NewEnvoyConfParser

func NewEnvoyConfParser() EnvoyConfParser

func (EnvoyConfParser) GetClusters

func (e EnvoyConfParser) GetClusters(conf EnvoyConf) (clusters []Cluster, nameToPortAndCiphersMap map[string]PortAndCiphers)

Parses the Envoy conf file and extracts the clusters and a map of cluster names to listeners

func (EnvoyConfParser) GetMTLS added in v0.4.0

func (e EnvoyConfParser) GetMTLS(conf EnvoyConf) bool

Checks if MTLS is enabled in the Envoy conf file. Defaults to returning false if require_client_certificate isn't set.

func (EnvoyConfParser) ReadUnmarshalEnvoyConfig added in v0.4.0

func (e EnvoyConfParser) ReadUnmarshalEnvoyConfig(envoyConfFile string) (EnvoyConf, error)

Read Envoy conf file and unmarshal it

type Filter

type Filter struct {
	Config Config `yaml:"config,omitempty"`
}

type FilterChain

type FilterChain struct {
	Filters    []Filter   `yaml:"filters,omitempty"`
	TLSContext TLSContext `yaml:"tls_context,omitempty"`
}

type Host

type Host struct {
	SocketAddress SocketAddress `yaml:"socket_address,omitempty"`
}

type Listener

type Listener struct {
	Address      Address       `yaml:"address,omitempty"`
	FilterChains []FilterChain `yaml:"filter_chains,omitempty"`
}

type NginxConfig

type NginxConfig struct {
	// contains filtered or unexported fields
}

func NewNginxConfig

func NewNginxConfig(envoyConfParser envoyConfParser, sdsCredParser sdsCredParser, sdsValidationParser sdsValidationParser, nginxDir string) NginxConfig

func (NginxConfig) Generate

func (n NginxConfig) Generate(envoyConfFile string) error

Generates NGINX config file.

func (NginxConfig) GetConfFile

func (n NginxConfig) GetConfFile() string

func (NginxConfig) GetNginxDir added in v0.4.1

func (n NginxConfig) GetNginxDir() string

func (NginxConfig) WriteTLSFiles

func (n NginxConfig) WriteTLSFiles() error

type PortAndCiphers added in v0.6.0

type PortAndCiphers struct {
	Port    string
	Ciphers string
}

type PrivateKey

type PrivateKey struct {
	InlineString string `yaml:"inline_string,omitempty"`
}

type Resource

type Resource struct {
	TLSCertificate TLSCertificate `yaml:"tls_certificate,omitempty"`
}

type Sds

type Sds struct {
	Resources []Resource `yaml:"resources,omitempty"`
}

type SdsCredParser

type SdsCredParser struct {
	// contains filtered or unexported fields
}

func NewSdsCredParser

func NewSdsCredParser(file string) SdsCredParser

func (SdsCredParser) GetCertAndKey

func (p SdsCredParser) GetCertAndKey() (string, string, error)

Parses the Envoy SDS file and extracts the cert and key

type SdsServerValidation

type SdsServerValidation struct {
	Resources []ValidationResource `yaml:"resources,omitempty"`
}

type SdsServerValidationParser

type SdsServerValidationParser struct {
	// contains filtered or unexported fields
}

func NewSdsServerValidationParser

func NewSdsServerValidationParser(file string) SdsServerValidationParser

func (SdsServerValidationParser) GetCACert

func (p SdsServerValidationParser) GetCACert() (string, error)

type SocketAddress

type SocketAddress struct {
	Address   string `yaml:"address,omitempty"`
	PortValue string `yaml:"port_value,omitempty"`
}

type StaticResources

type StaticResources struct {
	Clusters  []Cluster  `yaml:"clusters,omitempty"`
	Listeners []Listener `yaml:"listeners,omitempty"`
}

type TLSCertificate

type TLSCertificate struct {
	CertChain  CertChain  `yaml:"certificate_chain,omitempty"`
	PrivateKey PrivateKey `yaml:"private_key,omitempty"`
}

type TLSContext added in v0.4.0

type TLSContext struct {
	CommonTLSContext         CommonTLSContext `yaml:"common_tls_context,omitempty"`
	RequireClientCertificate bool             `yaml:"require_client_certificate,omitempty"`
}

type TLSParams added in v0.6.0

type TLSParams struct {
	CipherSuites []string `yaml:"cipher_suites,omitempty"`
}

type TrustedCA

type TrustedCA struct {
	InlineString string `yaml:"inline_string,omitempty"`
}

type ValidationContext

type ValidationContext struct {
	TrustedCA TrustedCA `yaml:"trusted_ca,omitempty"`
}

type ValidationResource

type ValidationResource struct {
	ValidationContext ValidationContext `yaml:"validation_context,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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