configuration

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationSchema

type ConfigurationSchema struct {
	Host     Host     `json:"host"`
	Database Database `json:"database"`
	Redis    Redis    `json:"redis"`
	Graceful Graceful `json:"graceful"`
}

func NewConfiguration

func NewConfiguration() *ConfigurationSchema

func (ConfigurationSchema) NewLogrus

func (cf ConfigurationSchema) NewLogrus() *logrus.Logger

func (ConfigurationSchema) NewPostgres

func (cf ConfigurationSchema) NewPostgres() database.DatabaseConfig

func (ConfigurationSchema) NewRedis

func (cf ConfigurationSchema) NewRedis() *redis.Client

type Database

type Database struct {
	Master                  string `json:"master"`
	Slave                   string `json:"slave"`
	RetryBackoff            int    `json:"retry_backoff" mapstructure:"retry_backoff"`
	IntervalCheckConnection int    `json:"interval_check_connection" mapstructure:"interval_check_connection"`
}

type Graceful

type Graceful struct {
	TimeoutInSecond int64 `json:"timeout_in_second" mapstructure:"timeout_in_second"`
}

type Host

type Host struct {
	Address string `json:"address"`
	Debug   bool   `json:"debug"`
}

type Redis

type Redis struct {
	Address  string `json:"address"`
	Password string `json:"password"`
	DB       int    `json:"db"`
	MaxRetry int    `json:"max_retry" mapstructure:"max_retry"`
}

Jump to

Keyboard shortcuts

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