config

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpPort = "HTTP_PORT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppVersion string
	Server     Server
	Logger     Logger
	MongoDB    MongoDB
	Kafka      Kafka
	Http       Http
	Redis      Redis
	Sentry     Sentry
}

Config of application

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig Parse config file

type Http

type Http struct {
	Port              string
	PprofPort         string
	Timeout           time.Duration
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	CookieLifeTime    int
	SessionCookieName string
}

type Kafka

type Kafka struct {
	Brokers []string
}

type Logger

type Logger struct {
	DisableCaller     bool
	DisableStacktrace bool
	Encoding          string
	Level             string
}

Logger config

type MongoDB

type MongoDB struct {
	URI         string
	User        string
	Password    string
	DB          string
	MaxPoolSize uint64
	MinPoolSize uint64
	RetryWrites bool
}

type Redis

type Redis struct {
	RedisAddr      string
	RedisPassword  string
	RedisDB        string
	RedisDefaultDB string
	MinIdleConn    int
	PoolSize       int
	PoolTimeout    int
	Password       string
	DB             int
}

type Sentry

type Sentry struct {
	SentryDSN string
}

type Server

type Server struct {
	Port              string
	Development       bool
	Timeout           time.Duration
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	MaxConnectionIdle time.Duration
	MaxConnectionAge  time.Duration
	Kafka             Kafka
}

Server config

Jump to

Keyboard shortcuts

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