config

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	PrivateKeyFilePath        string `yaml:"private-key"`
	CertificateFilePath       string `yaml:"path"`
	CertificateHosts          string `yaml:"hosts"`
	CertificateValidDuration  int    `yaml:"duration"`
	ActAsCertificateAuthority bool   `yaml:"-"`
	OnlyGenerateCertificate   bool   `yaml:"-"`
	ForceOverwrite            bool   `yaml:"-"`
}

Certificate holds the certificate/private key configuration for HTTPS.

type Config

type Config struct {
	Verbose           bool   `yaml:"verbose"`
	Path              string `yaml:"path"`
	ServePath         string `yaml:"serve-path"`
	ConfigurationFile string `yaml:"-"`

	UploadPath      string `yaml:"upload-path"`
	UploadServePath string `yaml:"upload-serve-path"`

	HTTP    HTTP    `yaml:"http"`
	HTTPS   HTTPS   `yaml:"https"`
	Metrics Metrics `yaml:"metrics"`
}

Config is the root of the server configuration.

func Load

func Load() *Config

Load loads the configuration for the server.

func (*Config) String

func (c *Config) String() string

String returns a string representation of the config.

type HTTP

type HTTP struct {
	Port int `yaml:"port"`
}

HTTP holds the configuration for HTTP serving.

type HTTPS

type HTTPS struct {
	Port        int         `yaml:"port"`
	Certificate Certificate `yaml:"certificate"`
}

HTTPS holds the configuration for HTTPS serving.

type Metrics

type Metrics struct {
	Enabled bool   `yaml:"enabled"`
	Path    string `yaml:"path"`
}

Metrics holds the metrics configuration.

Jump to

Keyboard shortcuts

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