config

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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
	ServiceName     string
	ServiceMainPath string
	Server          Server
	Logger          Logger
	MongoDB         MongoDB
	Kafka           Kafka
	Http            Http
	Redis           Redis
	Sentry          Sentry
	Lightstep       Lightstep
	Postgres        Postgres
	HTTPClient      HTTPClient
}

Config of application

func ParseConfig

func ParseConfig() (*Config, error)

ParseConfig Parse config file

type HTTPClient added in v0.4.2

type HTTPClient struct {
	InternalURL    string
	XApplicationID *string
	RetryCount     int
	RetryWaitTime  time.Duration
}

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 Lightstep added in v0.3.8

type Lightstep struct {
	AccessToken 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 Postgres added in v0.3.10

type Postgres struct {
	Host     string
	User     string
	Password string
	DB       string
	Port     uint64
	TimeZone *string
}

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