feat: 添加rabbitMQ
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
type Config struct {
|
||||
Server ServerConfig `yaml:"server"`
|
||||
Database DatabaseConfig `yaml:"database"`
|
||||
Redis RedisConfig `yaml:"redis"`
|
||||
RabbitMQ RabbitMQConfig `yaml:"rabbitmq"`
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -23,6 +25,20 @@ type DatabaseConfig struct {
|
||||
DBName string `yaml:"dbname"`
|
||||
}
|
||||
|
||||
type RedisConfig struct {
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
Password string `yaml:"password"`
|
||||
DB int `yaml:"db"`
|
||||
}
|
||||
|
||||
type RabbitMQConfig struct {
|
||||
Host string `yaml:"host"`
|
||||
Port int `yaml:"port"`
|
||||
Username string `yaml:"username"`
|
||||
Password string `yaml:"password"`
|
||||
}
|
||||
|
||||
func Load(filename string) (Config, error) {
|
||||
data, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user