config

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Origins map[string]struct {
		UseHttps       bool          `yaml:"useHttps"`
		MaxSize        int64         `yaml:"maxSize"`
		MaxAge         time.Duration `yaml:"maxAge"`
		MaxAge404      time.Duration `yaml:"maxAge404"`
		MaxAgeOverride bool          `yaml:"maxAgeOverride"`
		DownloadBurst  int64         `yaml:"downloadBurst"`
		DownloadRate   int64         `yaml:"downloadRate"`
	} `yaml:"origins"`
	Hosts map[string]struct {
		TLS *struct {
			Cert string `yaml:"cert"`
			Key  string `yaml:"key"`
		} `yaml:"tls"`
		Origin             string `yaml:"origin"`
		HttpsRedirect      bool   `yaml:"httpsRedirect"`
		HttpsRedirectPort  int    `yaml:"httpsRedirectPort"`
		HostOverride       bool   `yaml:"hostOverride"`
		IgnoreQuery        bool   `yaml:"ignoreQuery"`
		CompressionMaxSize int64  `yaml:"compressionMaxSize"`
		UploadBurst        int64  `yaml:"uploadBurst"`
		UploadRate         int64  `yaml:"uploadRate"`
	} `yaml:"hosts"`
}

func FromFile

func FromFile(name string) (c *Config, err error)

func New

func New(r io.Reader) (c *Config, err error)

func (*Config) TLSCertificates

func (c *Config) TLSCertificates() (certs map[string]*tls.Certificate, err error)

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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