configs

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CONFIG_FILENAME string = "config.yaml"
View Source
const CONFIG_FILENAME_SAMPLE string = "config-sample.yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	GrpcServer     GrpcServerConfig     `yaml:"grpc_server"`
	GrpcClient     GrpcClientConfig     `yaml:"grpc_client"`
	HttpServer     HttpServerConfig     `yaml:"http_server"`
	Rabbit         RabbitConfig         `yaml:"rabbitmq"`
	TcpClient      TcpClientConfig      `yaml:"tcp_client"`
	TcpServer      TcpServerConfig      `yaml:"tcp_server"`
	TcpProxyServer TcpProxyServerConfig `yaml:"proxy_server"`
	Sql            SqlConfig            `yaml:"sql"`
	SecretKey      string               `yaml:"secret_key"`
	Kafka          KafkaConfig          `yaml:"kafka"`
	Redis          RedisConfig          `yaml:"redis"`
	Websocket      WebsocketConfig      `yaml:"websocket"`
	MailClient     MailClientConfig     `yaml:"mail_client"`
}

func GetConfigs

func GetConfigs() *Cfg

Singleton pattern

type GrpcClientConfig

type GrpcClientConfig struct {
	ServerAddress string `yaml:"grpc_server"`
}

type GrpcServerConfig

type GrpcServerConfig struct {
	Address string `yaml:"grpc_addr"`
}

type HttpServerConfig

type HttpServerConfig struct {
	Address string `yaml:"http_addr"`
}

type KafkaConfig

type KafkaConfig struct {
	Addr      string `yaml:"kafka_addr"`
	Topic     string `yaml:"kafka_topic"`
	Group     string `yaml:"kafka_group"`
	Partition int    `yaml:"kafka_partition"`
}

type MailClientConfig

type MailClientConfig struct {
	ServerName string `yaml:"mail_server"`
	SmtpAddr   string `yaml:"mail_smtp_addr"`
	UserName   string `yaml:"mail_username"`
	Password   string `yaml:"mail_password"`
}

type RabbitConfig

type RabbitConfig struct {
	Host           string `yaml:"rabbitmq_host"`
	Queue          string `yaml:"rabbitmq_queue"`
	BackupFileName string `yaml:"backup_filename"`
	BackupFolder   string `yaml:"backup_folder"`
}

type RedisConfig

type RedisConfig struct {
	Addr     string `yaml:"redis_addr"`
	Password string `yaml:"redis_password"`
}

type SqlConfig

type SqlConfig struct {
	Addr string `yaml:"sql_addr"`
}

type TcpClientConfig

type TcpClientConfig struct {
	TcpServerUrl string `yaml:"tcp_server_url"`
	ServerName   string `yaml:"server_name"`
	ClientName   string `yaml:"client_name"`
}

type TcpProxyServerConfig

type TcpProxyServerConfig struct {
	ProxyAddress string `yaml:"proxy_address"`
}

type TcpServerConfig

type TcpServerConfig struct {
	TcpPort string `yaml:"tcp_addr"`
}

type WebsocketConfig

type WebsocketConfig struct {
	Addr string `yaml:"websocket_addr"`
}

Jump to

Keyboard shortcuts

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