runner

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config, l gof.Logger, router http.Handler)

Types

type Config

type Config struct {
	ListenAddr         string        `default:"" yaml:"listen_addr" json:"listen_addr"`
	Port               int           `default:"80"`
	ReadTimeout        time.Duration `default:"10s" yaml:"read_timeout" json:"read_timeout"`
	WriteTimeout       time.Duration `default:"10s" yaml:"write_timeout" json:"write_timeout"`
	MaxHeaderMegabytes int           `default:"1" yaml:"max_header_megabytes" json:"max_header_megabytes"`
	KeepAlive          time.Duration `yaml:"keep_alive" json:"keep_alive"`
	SSL                SSLConfig
}

type LetsEncryptConfig

type LetsEncryptConfig struct {
	Enabled   bool   `default:"false"`
	AcceptTOS bool   `default:"false" yaml:"accept_tos" json:"accept_tos"`
	Cache     string `default:"data/certs"`
	Hosts     []string
}

type SSLConfig

type SSLConfig struct {
	Enabled         bool              `default:"false"`
	RedirectToHTTPS bool              `default:"true" yaml:"redirect_to_https" json:"redirect_to_https"`
	ListenAddr      string            `default:"" yaml:"listen_addr" json:"listen_addr"`
	Port            int               `default:"443"`
	CertFile        string            `default:"" yaml:"cert_file" json:"cert_file"`
	CertKey         string            `default:"" yaml:"cert_key" json:"cert_key"`
	LetsEncrypt     LetsEncryptConfig `yaml:"lets_encrypt" json:"lets_encrypt"`
}

Jump to

Keyboard shortcuts

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