config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config defines common config struct to avoid cycle dependency

Index

Constants

View Source
const (
	ShutdownDuration = 1 * time.Second
)

Variables

View Source
var EmptyDatabaseConfig = DatabaseConfig{}

Functions

This section is empty.

Types

type DatabaseConfig

type DatabaseConfig struct {
	Name     string `yaml:"name"`
	Adapter  string `yaml:"adapter"`
	DSN      string `yaml:"dsn"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DBName   string `yaml:"dbname"`
	SSLMode  string `yaml:"sslmode"`
}

DatabaseConfig specifies information required to connect to a database

func (DatabaseConfig) String

func (c DatabaseConfig) String() string

type DatabaseManagerConfig

type DatabaseManagerConfig struct {
	Default   string           `yaml:"default"`
	Databases []DatabaseConfig `yaml:"databases"`
}

DatabaseManagerConfig specifies the default database to use, and config for all available databases including the one with default name

type GrpcServerConfig

type GrpcServerConfig struct {
	// Addr is host:port passed to net/http directly, i.e. :8080 means listen to all requests to port 8080
	Addr string `yaml:"addr"`
	// Secure specifies if SSL should be used
	Secure bool `yaml:"secure"`
	// Cert is path of ssl cert generated by openssl
	Cert string `yaml:"cert"`
	// Key is path of ssl key generated by openssl
	Key string `yaml:"key"`
	// EnableTracing decides if tracing is enabled on grpc server
	EnableTracing bool `yaml:"enableTracing"`
	// ShutdownDuration for graceful shutdown grpc server
	ShutdownDuration time.Duration `yaml:"shutdownDuration"`
}

type HttpServerConfig

type HttpServerConfig struct {
	// Addr is host:port passed to net/http directly, i.e. :8080 means listen to all requests to port 8080
	Addr string `yaml:"addr"`
	// Secure specifies if SSL should be used
	Secure bool `yaml:"secure"`
	// Cert is path of ssl cert generated by openssl
	Cert string `yaml:"cert"`
	// Key is path of ssl key generated by openssl
	Key string `yaml:"key"`
	// EnableTracing decides if tracing is enabled on http server
	EnableTracing bool `yaml:"enableTracing"`
	// ShutdownDuration for graceful shutdown http server
	ShutdownDuration time.Duration `yaml:"shutdownDuration"`
}

type TracingConfig

type TracingConfig struct {
	Adapter  string                 `yaml:"adapter"`
	Sampler  TracingSamplerConfig   `yaml:"sampler"`
	Reporter TracingReporterConfig  `yaml:"reporter"`
	XXX      map[string]interface{} `yaml:",inline"`
}

type TracingReporterConfig

type TracingReporterConfig struct {
	LogSpans           bool                   `yaml:"logSpans"`
	LocalAgentHostPort string                 `yaml:"localAgentHostPort"`
	XXX                map[string]interface{} `yaml:",inline"`
}

type TracingSamplerConfig

type TracingSamplerConfig struct {
	// - for "const" sampler, 0 or 1 for always false/true respectively
	// - for "probabilistic" sampler, a probability between 0 and 1
	// - for "rateLimiting" sampler, the number of spans per second
	// - for "remote" sampler, param is the same as for "probabilistic"
	Type  string  `yaml:"type"`
	Param float64 `yaml:"param"`
	// TODO: we ignore sampling server, which can control sampling rate
	XXX map[string]interface{} `yaml:",inline"`
}

Jump to

Keyboard shortcuts

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