TinySkin/model/yggdrasil/textures.go
thehrz 145bb045e9
Some checks failed
CI / deploy (push) Failing after 2m53s
fork from xmdhs/authlib-skin
2025-01-24 16:57:58 +08:00

29 lines
580 B
Go

package yggdrasil
import (
"encoding/base64"
"encoding/json"
)
type UserTextures struct {
// UUID
ProfileID string `json:"profileId"`
ProfileName string `json:"profileName"`
Textures map[string]Textures `json:"textures"`
// 时间戳 毫秒
Timestamp int64 `json:"timestamp"`
}
type Textures struct {
Url string `json:"url"`
Metadata map[string]string `json:"metadata"`
}
func (u UserTextures) Base64() string {
b, err := json.Marshal(u)
if err != nil {
panic(err)
}
return base64.StdEncoding.EncodeToString(b)
}