Documentation ¶
Index ¶
- func Init(dir, env string, conf *Config) (string, error)
- func LoadConfig(dir string, name string, env string, conf interface{}) (string, error)
- type Client
- type Config
- type Database
- type Elasticsearch
- type HTTP
- type HTTPTransport
- type Kafka
- type KafkaConsumer
- type KafkaProducer
- type Log
- type LogRotate
- type Metrics
- type PProf
- type Prometheus
- type Redis
- type Reporter
- type Server
- type Trace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Name string Host string Port int Protocol string Timeout time.Duration TimeoutMillSec time.Duration Transport HTTPTransport }
Client ...
type Config ¶
type Config struct { Server Server Redis []Redis Database []Database Client []Client Elasticsearch []Elasticsearch Kafka []Kafka }
Config config
type Database ¶
type Database struct { Name string Driver string DataSource string Host string Port int User string Pass string DB string Charset string InterpolateParams string }
Database config ...
type Elasticsearch ¶
type Elasticsearch struct { Name string Addrs []string Username string Password string CustomTranport bool Transport HTTPTransport }
Elasticsearch ...
type HTTPTransport ¶
type HTTPTransport struct { Customized bool MillSecUnit bool IdleConnTimeout time.Duration TLSHandshakeTimeout time.Duration ExpectContinueTimeout time.Duration ResponseHeaderTimeout time.Duration MaxConnsPerHost int MaxIdleConns int MaxIdleConnsPerHost int DisableKeepAlives bool DisableCompression bool }
HTTPTransport ...
type Kafka ¶
type Kafka struct { Name string Addrs []string CustomConfig bool Producer KafkaProducer Consumer KafkaConsumer }
Kafka ...
type Log ¶
type Log struct { Level string `toml:"level"` Development bool `toml:"development"` DisableCaller bool `toml:"disableCaller"` DisableStacktrace bool `toml:"disableStacktrace"` OutputPath string `toml:"outputPath"` Rotate LogRotate }
Log log config
type LogRotate ¶
type LogRotate struct { Filename string MaxSize int // megabytes MaxBackups int MaxAge int // days LocalTime bool Compress bool }
LogRotate ...
type Prometheus ¶
type Prometheus struct { Addr string DisableHTTPServerRequestsTotalCounter bool DisableHTTPServerRequestsDurationHistogram bool DisableHTTPServerRequestsDurationSummary bool DisableHTTPClientRequestsTotalCounter bool DisableHTTPClientRequestsDurationHistogram bool DisableHTTPClientRequestsDurationSummary bool DisableLogTotalCounter bool HTTPServerRequestsDurationHistogramBuckets []float64 HTTPServerRequestsDurationSummaryObjectives map[float64]float64 HTTPClientRequestsDurationHistogramBuckets []float64 HTTPClientRequestsDurationSummaryObjectives map[float64]float64 }
Prometheus ...
type Reporter ¶
type Reporter struct { CollectorEndpoint string LocalAgentHostPort string BufferFlushInterval time.Duration }
Reporter ...
Click to show internal directories.
Click to hide internal directories.