mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-02 00:11:56 +03:00
Correct printable configuration
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ func Proxy() error {
|
|||||||
if err := config.InitPublicAddress(ctx); err != nil {
|
if err := config.InitPublicAddress(ctx); err != nil {
|
||||||
Fatal(err)
|
Fatal(err)
|
||||||
}
|
}
|
||||||
zap.S().Debugw("Configuration", "config", config.C)
|
zap.S().Debugw("Configuration", "config", config.C.Printable())
|
||||||
|
|
||||||
if len(config.C.AdTag) > 0 {
|
if len(config.C.AdTag) > 0 {
|
||||||
zap.S().Infow("Use middle proxy connection to Telegram")
|
zap.S().Infow("Use middle proxy connection to Telegram")
|
||||||
|
|||||||
@@ -137,6 +137,20 @@ type Config struct {
|
|||||||
AdTag []byte `json:"adtag"`
|
AdTag []byte `json:"adtag"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c Config) Printable() interface{} {
|
||||||
|
data, err := json.Marshal(c)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rv := map[string]interface{}{}
|
||||||
|
if err := json.Unmarshal(data, &rv); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv
|
||||||
|
}
|
||||||
|
|
||||||
func (c Config) String() string {
|
func (c Config) String() string {
|
||||||
data, _ := json.Marshal(c)
|
data, _ := json.Marshal(c)
|
||||||
return string(data)
|
return string(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user