Documentation ¶
Overview ¶
Package tomlconfig defines the TOML config for Web Packager HTTP Server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶
type CacheConfig struct {
MaxEntries int `default:"200"`
}
CacheConfig represents the [Cache] section.
type Config ¶
type Config struct { Listen ListenConfig Server ServerConfig SXG SXGConfig Sign SignConfig Processor ProcessorConfig Cache CacheConfig }
Config defines the TOML config. See cmd/webpkgserver/webpkgserver.example.toml for detail.
func ParseConfig ¶
ParseConfig parses data into a Config. It also validates all fields and returns error if the validation fails.
func ReadFromFile ¶
ReadFromFile reads a Config from filename. It also validates all fields and returns error if the validation fails.
type ListenConfig ¶
ListenConfig represents the [Listen] section.
type ProcessorConfig ¶
ProcessorConfig represents the [Processor] section.
type SXGACMEConfig ¶
type SXGACMEConfig struct { Enable bool CSRFile string DiscoveryURL string Email string EABKid string EABHmac string HTTPChallengePort int HTTPWebRootDir string TLSChallengePort int DNSProvider string }
SXGACMEConfig represents the [SXG.ACME] section.
type SXGCertConfig ¶
SXGCertConfig represents the [SXG.Cert] section.
type SXGConfig ¶
type SXGConfig struct { Expiry string `default:"168h"` JSExpiry string `default:"24h"` CertURLBase string `default:"/webpkg/cert"` ValidityURL string `default:"/webpkg/validity"` KeepNonSXGPreloads bool Cert SXGCertConfig ACME SXGACMEConfig }
SXGConfig represents the [SXG] section.
func (*SXGConfig) GetCertURLBase ¶
GetCertURLBase returns a parsed c.CertURLBase. It panics if c.CertURLBase cannot be parsed; it should not happen if c is obtained using ParseConfig or ReadFromFile.
func (*SXGConfig) GetExpiry ¶
GetExpiry returns a parsed c.Expiry. It panics if c.Expiry contains an invalid value; it should not happen if c is obtained using ParseConfig or ReadFromFile.
func (*SXGConfig) GetJSExpiry ¶
GetJSExpiry returns a parsed c.JSExpiry. It panics if c.JSExpiry contains an invalid value; it should not happen if c is obtained using ParseConfig or ReadFromFile.
func (*SXGConfig) GetValidityURL ¶
GetValidityURL returns a parsed c.ValidityURL. It panics if c.ValidityURL cannot be parsed; it should not happen if c is obtained using ParseConfig or ReadFromFile.
type ServerConfig ¶
type ServerConfig struct { DocPath string `default:"/priv/doc"` CertPath string `default:"/webpkg/cert"` ValidityPath string `default:"/webpkg/validity"` HealthPath string `default:"/healthz"` SignParam string `default:"sign"` }
ServerConfig represents the [Server] section.
type URLConfig ¶
URLConfig represents each of the [[Sign]] sections.
func (*URLConfig) GetPathRE ¶
GetPathRE returns a compiled c.PathRE. It also encloses the regexp with `\A(?:...)\z` to make it a full match. It panics if c.PathRE is malformed; it should not happen if c is obtained using ParseConfig or ReadFromFile.
func (*URLConfig) GetQueryRE ¶
GetQueryRE returns a compiled c.QueryRE. It also encloses the regexp with `\A(?:...)\z` to make it a full match. It panics if c.PathRE is malformed; it should not happen if c is obtained using ParseConfig or ReadFromFile.