mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-05 16:38:17 -04:00
21 lines
331 B
Go
21 lines
331 B
Go
package templates
|
|
|
|
import "encoding/json"
|
|
|
|
type UniversalDot struct {
|
|
Content []byte
|
|
|
|
AsJson interface{}
|
|
}
|
|
|
|
func NewUniversalDot(content []byte) *UniversalDot {
|
|
return &UniversalDot{Content: content}
|
|
}
|
|
|
|
func (ud *UniversalDot) IsJson() bool {
|
|
if nil == json.Unmarshal(ud.Content, &ud.AsJson) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|