settings

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Settings)

func GrpcUnaryInterceptor

func GrpcUnaryInterceptor(i grpc.UnaryServerInterceptor) Option

type Settings

type Settings struct {
	// runtime options
	GrpcUnaryInterceptor grpc.ServerOption
	// env config
	Port                       int    `envconfig:"PORT" default:"8080"`
	GrpcPort                   int    `envconfig:"GRPC_PORT" default:"8081"`
	DebugPort                  int    `envconfig:"DEBUG_PORT" default:"6070"`
	UseStatsd                  bool   `envconfig:"USE_STATSD" default:"true"`
	StatsdHost                 string `envconfig:"STATSD_HOST" default:"localhost"`
	StatsdPort                 int    `envconfig:"STATSD_PORT" default:"8125"`
	RuntimePath                string `envconfig:"RUNTIME_ROOT" default:"/srv/runtime_data/current"`
	RuntimeSubdirectory        string `envconfig:"RUNTIME_SUBDIRECTORY"`
	LogLevel                   string `envconfig:"LOG_LEVEL" default:"WARN"`
	RedisSocketType            string `envconfig:"REDIS_SOCKET_TYPE" default:"unix"`
	RedisUrl                   string `envconfig:"REDIS_URL" default:"/var/run/nutcracker/ratelimit.sock"`
	RedisPoolSize              int    `envconfig:"REDIS_POOL_SIZE" default:"10"`
	RedisPerSecond             bool   `envconfig:"REDIS_PERSECOND" default:"false"`
	RedisPerSecondSocketType   string `envconfig:"REDIS_PERSECOND_SOCKET_TYPE" default:"unix"`
	RedisPerSecondUrl          string `envconfig:"REDIS_PERSECOND_URL" default:"/var/run/nutcracker/ratelimitpersecond.sock"`
	RedisPerSecondPoolSize     int    `envconfig:"REDIS_PERSECOND_POOL_SIZE" default:"10"`
	ExpirationJitterMaxSeconds int64  `envconfig:"EXPIRATION_JITTER_MAX_SECONDS" default:"300"`
}

func NewSettings

func NewSettings() Settings

Jump to

Keyboard shortcuts

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