.
Some checks failed
Deploy to Mac Mini / Test (push) Failing after 54s
Deploy to Mac Mini / Deploy (push) Has been skipped

This commit is contained in:
2026-02-26 21:33:22 +09:00
parent dabf1f3ba9
commit 3240b57dca
5 changed files with 124 additions and 4 deletions

View File

@@ -50,12 +50,12 @@ type AOIConfig struct {
}
type NetworkConfig struct {
WriteBufferSize int `yaml:"write_buffer_size"`
ReadBufferSize int `yaml:"read_buffer_size"`
SendChannelSize int `yaml:"send_channel_size"`
WriteBufferSize int `yaml:"write_buffer_size"`
ReadBufferSize int `yaml:"read_buffer_size"`
SendChannelSize int `yaml:"send_channel_size"`
HeartbeatInterval time.Duration `yaml:"heartbeat_interval"`
HeartbeatTimeout time.Duration `yaml:"heartbeat_timeout"`
MaxMessageSize int64 `yaml:"max_message_size"`
MaxMessageSize int64 `yaml:"max_message_size"`
}
type LogConfig struct {
@@ -81,6 +81,23 @@ func Load(path string) (*Config, error) {
return nil, fmt.Errorf("parse config file: %w", err)
}
// 환경변수로 DB 접속 정보 오버라이드 (Docker 환경용)
if v := os.Getenv("DB_HOST"); v != "" {
cfg.Database.Host = v
}
if v := os.Getenv("DB_PORT"); v != "" {
fmt.Sscanf(v, "%d", &cfg.Database.Port)
}
if v := os.Getenv("DB_USER"); v != "" {
cfg.Database.User = v
}
if v := os.Getenv("DB_PASSWORD"); v != "" {
cfg.Database.Password = v
}
if v := os.Getenv("DB_NAME"); v != "" {
cfg.Database.DBName = v
}
return cfg, nil
}