config

package
v0.0.0-...-c16f518 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name string `env-required:"true" yaml:"name" json:"name,omitempty" env:"APP_NAME"`
}

type Grpc

type Grpc struct {
	Host       string `yaml:"host" json:"host,omitempty" env:"GRPC_HOST" env-default:"0.0.0.0"`
	Port       int    `yaml:"port" json:"port,omitempty" env:"GRPC_PORT" env-default:"5000"`
	LogPayload *bool  `yaml:"log_payload" json:"log_payload,omitempty" env:"GRPC_LOG_PAYLOAD" env-default:"true"`
}

type Log

type Log struct {
	Format string `yaml:"format" json:"format,omitempty" env:"LOG_FORMAT" env-default:"text"`
	Level  string `yaml:"level" json:"level,omitempty" env:"LOG_LEVEL" env-default:"info"`

	// Log file
	File       string `yaml:"file" json:"file,omitempty" env:"LOG_FILE"`
	MaxSize    int    `yaml:"max_size" json:"max_size,omitempty" env:"LOG_MAX_SIZE" env-default:"100"` // MB
	MaxBackups int    `yaml:"max_backups" json:"max_backups,omitempty" env:"LOG_MAX_BACKUPS" env-default:"5"`
	MaxAge     int    `yaml:"max_age" json:"max_age,omitempty" env:"LOG_MAX_AGE" env-default:"28"` // days
}

type Postgres

type Postgres struct {
	Host     string `yaml:"host" json:"host,omitempty" env:"POSTGRES_HOST" env-default:"localhost"`
	Port     int    `yaml:"port" json:"port,omitempty" env:"POSTGRES_PORT" env-default:"5432"`
	User     string `yaml:"user" json:"user,omitempty" env:"POSTGRES_USER" env-default:"postgres"`
	Password string `yaml:"password" json:"password,omitempty" env:"POSTGRES_PASSWORD" env-default:"postgres"`
	Database string `yaml:"database" json:"database,omitempty" env:"POSTGRES_DB" env-default:"postgres"`

	SSLMode string `yaml:"ssl_mode" json:"ssl_mode,omitempty" env:"POSTGRES_SSL_MODE" env-default:"disable"`
	Migrate bool   `yaml:"migrate" json:"migrate,omitempty" env:"POSTGRES_MIGRATE" env-default:"true"`

	MaxConns int32 `yaml:"max_conns" json:"max_conns,omitempty" env:"POSTGRES_MAX_CONNS" env-default:"10"`
	MinConns int32 `yaml:"min_conns" json:"min_conns,omitempty" env:"POSTGRES_MIN_CONNS" env-default:"1"`

	MaxConnIdleTime string `yaml:"max_conn_idle_time" json:"max_conn_idle_time,omitempty" env:"POSTGRES_MAX_CONN_IDLE_TIME" env-default:"5m"`
	MaxConnLifetime string `yaml:"max_conn_lifetime" json:"max_conn_lifetime,omitempty" env:"POSTGRES_MAX_CONN_LIFETIME" env-default:"5m"`
	ConnTimeout     string `yaml:"conn_timeout" json:"conn_timeout,omitempty" env:"POSTGRES_CONN_TIMEOUT" env-default:"15s"`
}

type Pprof

type Pprof struct {
	Enable *bool  `yaml:"enable" json:"enable,omitempty" env:"PPROF_ENABLE" env-default:"true"`
	Host   string `yaml:"host" json:"host,omitempty" env:"PPROF_HOST" env-default:"0.0.0.0"`
	Port   int    `yaml:"port" json:"port,omitempty" env:"PPROF_PORT" env-default:"6060"`
}

type Server

type Server struct {
	Pprof Pprof `yaml:"pprof" json:"pprof"`
	Grpc  Grpc  `yaml:"grpc" json:"grpc"`
}

Jump to

Keyboard shortcuts

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