config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 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                 *MySQLConfig
	StubCacheTTL       time.Duration
	StubCacheStrategy  string
	BodyStoreThreshold int
}

Config defines config for application

func NewConfig

func NewConfig() *Config

type MySQLConfig

type MySQLConfig struct {
	DSN                       string `json:"dsn" yaml:"dsn"`
	Server                    string `json:"server" yaml:"server"`
	Schema                    string `json:"schema" yaml:"schema"`
	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"`
}

MySQLConfig contains config data to connect to MySQL database

func NewDBConfig

func NewDBConfig() *MySQLConfig

NewDBConfig loads db schema config

Jump to

Keyboard shortcuts

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