chat/internal/config/config.go

41 lines
735 B
Go
Raw Permalink Normal View History

2025-12-31 09:36:02 +00:00
package config
import (
"github.com/zeromicro/go-zero/rest"
)
type Config struct {
rest.RestConf
Redis RedisConf
Centrifugo CentrifugoConf
Cassandra CassandraConf
JWT JWTConf
}
type RedisConf struct {
Host string
Port int
Password string
DB int
}
type CentrifugoConf struct {
APIURL string
APIKey string
}
type CassandraConf struct {
Hosts []string
Port int
Keyspace string
Username string
Password string
UseAuth bool
}
type JWTConf struct {
Secret string
Expire int64 // seconds - API token 和 Centrifugo token 共用此過期時間
CentrifugoSecret string // for Centrifugo JWT - 如果為空,則使用與 Secret 相同的值(簡化配置)
}