config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// DefaultQueryIdleConnectionTimeout is the default maximum amount
	// of time an idle (keep-alive) connection will remain idle before
	// closing itself.
	DefaultQueryIdleConnectionTimeout = 90 * time.Second

	// DefaultQueryMaxIdleConnectionCount is the default maximum number
	// of idle (keep-alive) connections across all hosts.
	DefaultQueryMaxIdleConnectionCount = 100

	// DefaultQueryTimeout is the default time limit for requests.
	DefaultQueryTimeout = 5 * time.Second
)
View Source
const (
	// DefaultListenAddress is the default listen address for Consulate.
	DefaultListenAddress = ":8080"

	// DefaultConsulAddress is the default address used to connect to Consul.
	DefaultConsulAddress = "localhost:8500"

	// DefaultReadTimeout is the default maximum duration for Consulate reading the entire request.
	DefaultReadTimeout = 10 * time.Second

	// DefaultWriteTimeout is the default maximum duration for Consulate writing the response.
	DefaultWriteTimeout = 10 * time.Second

	// DefaultShutdownTimeout the default maximum duration before timing out the shutdown of the Consulate server.
	DefaultShutdownTimeout = 15 * time.Second
)
View Source
const (
	// DefaultConsulCacheDuration is the default duration that Consul results will be cached.
	DefaultConsulCacheDuration = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	ConsulCacheDuration time.Duration
}

CacheConfig represents the configuration of caching the Consulate server.

func DefaultCacheConfig

func DefaultCacheConfig() *CacheConfig

DefaultCacheConfig gets a default CacheConfig.

type ClientConfig

type ClientConfig struct {
	QueryTimeout                time.Duration
	QueryMaxIdleConnectionCount int
	QueryIdleConnectionTimeout  time.Duration
}

ClientConfig represents the configuration for the http.Client.

func DefaultClientConfig

func DefaultClientConfig() *ClientConfig

DefaultClientConfig gets a default ClientConfig.

type ServerConfig

type ServerConfig struct {
	ListenAddress   string
	ConsulAddress   string
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	ShutdownTimeout time.Duration
	ClientConfig    ClientConfig
	CacheConfig     CacheConfig
}

ServerConfig represents the configuration of the Consulate server.

func DefaultServerConfig

func DefaultServerConfig() *ServerConfig

DefaultServerConfig gets a default ServerConfig.

Jump to

Keyboard shortcuts

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