config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSRF

type CSRF struct {
	DevelopmentMode   bool   `json:"development_mode"`
	AuthenticationKey string `json:"authentication_key"`
}

func (CSRF) Key

func (c CSRF) Key() ([]byte, bool, error)

Key returns the configured 32 byte CSRF key, and a bool indicating whether development mode is enabled. If the CSRF is not well formed, an error is returned.

type Configuration

type Configuration struct {
	WebServer   WebServer             `json:"web_server"`
	CSRF        CSRF                  `json:"csrf"`
	Database    setup.PersistentStore `json:"database_storage"`
	Statsd      stats.Statsd          `json:"statsd"`
	Proxies     Proxies               `json:"proxies"`
	ProxyClient ProxyClient           `json:"proxy_client"`
}

func (Configuration) String

func (c Configuration) String() string

type Proxies

type Proxies struct {
	PruneAfter int `json:"prune_after_s"`
}

type ProxyClient added in v0.10.0

type ProxyClient struct {
	Protocol string `json:"protocol"` // e.g. "https"
	BaseURL  string `json:"base_url"` // e.g. "proxy.golang.org"
}

type WebServer

type WebServer struct {
	TLS struct {
		Enabled     bool   `json:"enabled"`
		Certificate string `json:"certificate"`
		Key         string `json:"key"`
	} `json:"tls"`
	BindAddress   string   `json:"bind_address"`
	Port          int      `json:"port"`
	ReadTimeoutS  int      `json:"read_timeout_s"`
	WriteTimeoutS int      `json:"write_timeout_s"`
	APIKeys       []string `json:"api_keys"`
}

func (WebServer) Server

func (s WebServer) 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