config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTLSsite

func IsTLSsite(site Site) bool

IsTLSsite inspects site config to see if can be served under ssl

func Test

func Test(t *testing.T)

Types

type Configuration

type Configuration struct {
	LogLevel            string  `yaml:"logLevel"`
	RequirementPath     string  `yaml:"requirementPath"`
	TLSPort             string  `yaml:"TLSPort"`
	Port                string  `yaml:"port"`
	AllowDirectoryIndex bool    `yaml:"allowDirectoryIndex"`
	SitesAvailable      []Site  `yaml:"sitesAvailable"`
	DisableHealthCheck  bool    `yaml:"disableHealthCheck"`
	HealthCheckPort     int     `yaml:"healthCheckPort"`
	Compress            bool    `yaml:"compress"`
	CompressLevel       int     `yaml:"compressionLevel"`
	Expires             expires `yaml:"expires"`
	ExpiresParsed       ExpiresParsed
}

Configuration is the configuration loaded from config.yaml

var Config Configuration

Config global app configuration

func ReadConfig

func ReadConfig(filePath string) (*Configuration, error)

ReadConfig reads the config from the file provided and parses it as Yaml returning a Config object if parsed successfully.

type ExpiresParsed

type ExpiresParsed map[string]time.Duration

ExpiresParsed type is processed config of what duration to add to each file type

type Site

type Site struct {
	StaticPath    string  `yaml:"path"`
	IndexFile     string  `yaml:"index"`
	HostName      string  `yaml:"host"`
	CertFile      string  `yaml:"certFile"`
	KeyFile       string  `yaml:"keyFile"`
	Redirect      bool    `yaml:"redirectNonTLS"`
	Compress      bool    `yaml:"compress"`
	CompressLevel int     `yaml:"compressionLevel"`
	Expires       expires `yaml:"expires"`
	ExpiresParsed ExpiresParsed
}

Site holds configuration for individual spa sites

Jump to

Keyboard shortcuts

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