commit
6024763cc6
@ -2,24 +2,25 @@ package config
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/spf13/viper"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
var config *Config
|
var config *Config
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
ChatGpt ChatGptConfig `json:"chatgpt"`
|
ChatGpt ChatGptConfig `json:"chatgpt" mapstructure:"chatgpt" yaml:"chatgpt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatGptConfig struct {
|
type ChatGptConfig struct {
|
||||||
Token string `json:"token,omitempty" json:"token,omitempty"`
|
Token string `json:"token,omitempty" mapstructure:"token,omitempty" yaml:"token,omitempty"`
|
||||||
Wechat *string `json:"wechat,omitempty"`
|
Wechat *string `json:"wechat,omitempty" mapstructure:"wechat,omitempty" yaml:"wechat,omitempty"`
|
||||||
WechatKeyword *string `json:"wechat_keyword"`
|
WechatKeyword *string `json:"wechat_keyword" mapstructure:"wechat_keyword" yaml:"wechat_keyword"`
|
||||||
Telegram *string `json:"telegram"`
|
Telegram *string `json:"telegram" mapstructure:"telegram" yaml:"telegram"`
|
||||||
TgWhitelist *string `json:"tg_whitelist"`
|
TgWhitelist *string `json:"tg_whitelist" mapstructure:"tg_whitelist" yaml:"tg_whitelist"`
|
||||||
TgKeyword *string `json:"tg_keyword"`
|
TgKeyword *string `json:"tg_keyword" mapstructure:"tg_keyword" yaml:"tg_keyword"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadConfig() error {
|
func LoadConfig() error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user