config

package
v0.0.0-...-0aa8bca Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Secret string `json:"secret"`
}

type CacheConnection

type CacheConnection struct {
	CacheAddress  string `json:"cache_address"`
	CachePassword string `json:"cache_password"`
}

type Config

type Config struct {
	Server ServerConfig `yaml:"Server"`
	DB     DBConfig     `yaml:"DB"`
}

using driver yaml

type ConfigManager

type ConfigManager interface {
	Read() *MainConfig
}

func New

func New() ConfigManager

type DBConfig

type DBConfig struct {
	RetryInterval int    `yaml:"RetryInterval"`
	MaxIdleConn   int    `yaml:"MaxIdleConn"`
	MaxConn       int    `yaml:"MaxConn"`
	DSN           string `yaml:"DSN"`
}

type DatabaseConnectionString

type DatabaseConnectionString struct {
	Master string `json:"master"`
	Slave  string `json:"slave"`
}

type MainConfig

type MainConfig struct {
	DBConnectionString DatabaseConnectionString `json:"db_connection"`
	RestPort           string                   `json:"rest_port"`
	CacheConnection    CacheConnection          `json:"cache_connection"`
	AppConfig          AppConfig                `json:"app_config"`
}

type ServerConfig

type ServerConfig struct {
	Port                    string `yaml:"Port"`
	BasePath                string `yaml:"BasePath"`
	GracefulTimeoutInSecond int    `yaml:"GracefulTimeout"`
	ReadTimeoutInSecond     int    `yaml:"ReadTimeout"`
	WriteTimeoutInSecond    int    `yaml:"WriteTimeout"`
	APITimeout              int    `yaml:"APITimeout"`
}

Jump to

Keyboard shortcuts

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