config

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EVDuration

func EVDuration(name string, fallback time.Duration) time.Duration

func EVInt

func EVInt(name string, fallback int) int

func EVString

func EVString(name string, fallback string) string

Types

type Config

type Config struct {
	ServerAddress      string
	FileStorageType    string
	FileStorage        interface{}
	DB                 *PostgresConfig
	StubCacheTTL       time.Duration
	StubCacheStrategy  string
	BodyStoreThreshold int
}

Config defines config for application

func NewConfig

func NewConfig() *Config

type PostgresConfig added in v0.0.3

type PostgresConfig struct {
	Host                      string `json:"host" yaml:"host"`
	DBName                    string `json:"db_name" yaml:"db_name"`
	DBSchema                  string `json:"db_schema" yaml:"db_schema"`
	Port                      string `json:"port" yaml:"port"`
	User                      string `json:"user" yaml:"user"`
	Password                  string `json:"password" yaml:"password"`
	Option                    string `json:"option" yaml:"option"`
	ConnectionLifetimeSeconds int    `json:"connection_lifetime_seconds" yaml:"connection_lifetime_seconds"`
	MaxIdleConnections        int    `json:"max_idle_connections" yaml:"max_idle_connections"`
	MaxOpenConnections        int    `json:"max_open_connections" yaml:"max_open_connections"`
	EnableTracing             bool   `json:"enable_tracing" yaml:"enable_tracing"`
}

PostgresConfig contains config data to connect to MySQL database

func NewDBConfig

func NewDBConfig() *PostgresConfig

NewDBConfig loads db schema config

Jump to

Keyboard shortcuts

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