Documentation
¶
Index ¶
- func LoadEnvFile(path string) error
- func LoadEnvVars(cfg *Config) error
- func WriteToJson(c *Config, outputPath string) error
- type Config
- type EtcdConfig
- type GRPCClientConfig
- type GRPCConfig
- type GRPCFeatures
- type GRPCServerConfig
- type HTTPConfig
- type HTTPServerConfig
- type LoggingConfig
- type MongodbConfig
- type MongodbOptions
- type PrometheusConfig
- type RabbitMQConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadEnvFile ¶
func LoadEnvVars ¶
func WriteToJson ¶
Types ¶
type Config ¶
type Config struct {
Name string `json:"name"`
Title string `json:"title"`
Version string `json:"version"`
Env string `json:"env" env:"env"`
Mode string `json:"mode" env:"mode"`
Host string `json:"host" env:"host"`
Logging LoggingConfig `json:"logging"`
Mongodb *MongodbConfig `json:"mongodb,omitempty"`
Etcd *EtcdConfig `json:"etcd,omitempty"`
RabbiMQ *RabbitMQConfig `json:"rabbitmq,omitempty"`
Prometheus *PrometheusConfig `json:"prometheus,omitempty"`
GRPC *GRPCConfig `json:"grpc,omitempty"`
HTTP *HTTPConfig `json:"http,omitempty"`
}
type EtcdConfig ¶
type GRPCClientConfig ¶
type GRPCClientConfig struct {
Address string `json:"address" env:"grpc_client_address"`
}
type GRPCConfig ¶
type GRPCConfig struct {
Clients map[string]GRPCClientConfig `json:"clients"`
Servers map[string]GRPCServerConfig `json:"servers"`
}
type GRPCFeatures ¶
type GRPCServerConfig ¶
type GRPCServerConfig struct {
Port int `json:"port" env:"grpc_port"`
Features GRPCFeatures `json:"features"`
}
type HTTPConfig ¶
type HTTPConfig struct {
Servers map[string]HTTPServerConfig `json:"servers"`
}
type HTTPServerConfig ¶
type HTTPServerConfig struct {
Port int `json:"port" env:"http_port"`
}
type LoggingConfig ¶
type LoggingConfig struct {
Level string `json:"level" env:"log_level"`
}
type MongodbConfig ¶
type MongodbConfig struct {
URI string `json:"uri" env:"mongodb_uri"`
Username string `json:"username" env:"mongodb_username"`
Password string `json:"password" env:"mongodb_password"`
DbName string `json:"dbName" env:"mongodb_dbname"`
Hosts []string `json:"hosts"`
Options MongodbOptions `json:"options"`
}
type MongodbOptions ¶
type MongodbOptions struct {
ReplicaSet string `json:"replicaSet"`
}
type PrometheusConfig ¶
type PrometheusConfig struct {
GRPCMetrics bool `json:"grpcMetrics"`
}
type RabbitMQConfig ¶
type RabbitMQConfig struct {
URI string `json:"uri" env:"rabbitmq_uri"`
}
Click to show internal directories.
Click to hide internal directories.