24 lines
456 B
Go
24 lines
456 B
Go
|
|
package gorse
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"carrot_bbs/internal/config"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// Config Gorse客户端配置(从config.GorseConfig转换)
|
|||
|
|
type Config struct {
|
|||
|
|
Address string
|
|||
|
|
APIKey string
|
|||
|
|
Enabled bool
|
|||
|
|
Dashboard string
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// ConfigFromAppConfig 从应用配置创建Gorse配置
|
|||
|
|
func ConfigFromAppConfig(cfg *config.GorseConfig) Config {
|
|||
|
|
return Config{
|
|||
|
|
Address: cfg.Address,
|
|||
|
|
APIKey: cfg.APIKey,
|
|||
|
|
Enabled: cfg.Enabled,
|
|||
|
|
Dashboard: cfg.Dashboard,
|
|||
|
|
}
|
|||
|
|
}
|