config

package
v0.0.0-...-a3cfdba Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: EUPL-1.2 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Type    string `yaml:"type"`
	BaseURL string `yaml:"baseUrl"`

	Auth struct {
		Header map[string]string `yaml:"header"`
		Basic  struct {
			Username string `yaml:"username"`
			Password string `yaml:"password"`
		} `yaml:"basic"`
		TLS struct {
			RootCertificates string `yaml:"rootCertificates"`
			Certificate      string `yaml:"certificate"`
			Key              string `yaml:"key"`
		} `yaml:"tls"`
	}
}

type Config

type Config struct {
	ListenAddress string `yaml:"listenAddress"`
	ListenTLS     struct {
		Certificate string `yaml:"certificate"`
		Key         string `yaml:"key"`
	} `yaml:"listenTls"`
	AuthorizationServiceURL string             `yaml:"authorizationServiceUrl"`
	JwksURL                 string             `yaml:"jwksUrl"`
	Paths                   []Path             `yaml:"paths"`
	Backends                map[string]Backend `yaml:"backends"`
	Cors                    Cors               `yaml:"cors"`
}

func NewConfig

func NewConfig(configPath string) (*Config, error)

NewConfig returns a new decoded Config struct

type Cors

type Cors struct {
	AllowedOrigins      []string `yaml:"allowedOrigins"`
	AllowedMethods      []string `yaml:"allowedMethods"`
	AllowedHeaders      []string `yaml:"allowedHeaders"`
	AllowCredentials    bool     `yaml:"allowCredentials"`
	AllowPrivateNetwork bool     `yaml:"allowPrivateNetwork"`
	DebugLogging        bool     `yaml:"debugLogging"`
}

type Path

type Path struct {
	Path           string   `yaml:"path"`
	AllowedMethods []string `yaml:"allowedMethods"`
	Passthrough    bool     `yaml:"passthrough"`
	Backend        struct {
		Slug string `yaml:"slug"`
		Path string `yaml:"path"`
	} `yaml:"backend"`
	RequestRewrite  string `yaml:"requestRewrite"`
	ResponseRewrite string `yaml:"responseRewrite"`
}

Jump to

Keyboard shortcuts

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