parser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 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, UpstreamPort, ListenerPort, Name, Key, Cert, TrustedCA 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 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(envoyConfFile string) (clusters []Cluster, nameToPortMap map[string]string, err error)

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

type Filter

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

type FilterChain

type FilterChain struct {
	Filters []Filter `yaml:"filters,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, confDir string) NginxConfig

func (NginxConfig) Generate

func (n NginxConfig) Generate(envoyConfFile string) (string, error)

Generates NGINX config file. * There's aleady an nginx.conf in the blob but it's just a placeholder.

func (NginxConfig) GetConfDir

func (n NginxConfig) GetConfDir() string

func (NginxConfig) GetConfFile

func (n NginxConfig) GetConfFile() string

func (NginxConfig) WriteTLSFiles

func (n NginxConfig) WriteTLSFiles() error

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"`
}

* TODO: Try to use this auth_v2 "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth"?

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"`
}

* TODO: Try to use this auth_v2 "github.com/envoyproxy/go-control-plane/envoy/api/v2/auth"?

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 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