config

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBindAddress = errors.New("no bind address")
	ErrPortRange     = errors.New("port not within range")
)

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	BindAddress   string        `hcl:"bind_address"`
	Port          int           `hcl:"port"`
	ReadTimeout   time.Duration `hcl:"read_timeout"`
	WriteTimeout  time.Duration `hcl:"write_timeout"`
	MaxRequestLen int64         `hcl:"max_request_length"`
}

func Load

func Load() (Configuration, error)

func (Configuration) Address

func (c Configuration) Address() string

func (Configuration) Server

func (c Configuration) Server(mux http.Handler) (*http.Server, error)

Jump to

Keyboard shortcuts

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