config

package
v0.0.0-...-4687c92 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Production bool
	LogLevel   string `validate:"required,oneof=debug info warn error"`
	//	GrpcServer   GrpcConfig
	HttpServer HttpConfig
	Db         DbConfig
}

func New

func New() (*Config, error)

type DbConfig

type DbConfig struct {
	Host     string `validate:"required"`
	User     string
	Password string
	Database string
	TimeZone string `validate:"required"`
}

type GrpcConfig

type GrpcConfig struct {
	Port int `validate:"min=80"`
}

type HttpConfig

type HttpConfig struct {
	Port int `validate:"min=80"`
}

type MessageQueueConfig

type MessageQueueConfig struct {
	Url              string `validate:"required"`
	AllowReconnect   bool
	MaxReconnect     int    `validate:"min=1"`
	TimeoutMSec      int64  `validate:"min=1"`
	Name             string `validate:"required"`
	FcmQueueSubject  string `validate:"required"`
	ApnsQueueSubject string `validate:"required"`
	HcmQueueSubject  string `validate:"required"`
}

type RedisConfig

type RedisConfig struct {
	Nodes                  string        `validate:"required"`
	IdleCheckFrequencySecs time.Duration `validate:"min=1"`
	IdleTimeoutSecs        time.Duration `validate:"min=1"`
	PoolSize               int           `validate:"min=1"`
	Username               string
	Password               string
	DialTimeoutSecs        time.Duration
}

Jump to

Keyboard shortcuts

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