mirror of
https://github.com/elyby/chrly.git
synced 2024-11-30 10:42:14 +05:30
26 lines
557 B
Go
26 lines
557 B
Go
package mojangtextures
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/mono83/slf/wd"
|
|
|
|
"github.com/elyby/chrly/api/mojang"
|
|
)
|
|
|
|
var uuidToTextures = mojang.UuidToTextures
|
|
|
|
type MojangApiTexturesProvider struct {
|
|
Logger wd.Watchdog
|
|
}
|
|
|
|
func (ctx *MojangApiTexturesProvider) GetTextures(uuid string) (*mojang.SignedTexturesResponse, error) {
|
|
ctx.Logger.IncCounter("mojang_textures.textures.request", 1)
|
|
|
|
start := time.Now()
|
|
result, err := uuidToTextures(uuid, true)
|
|
ctx.Logger.RecordTimer("mojang_textures.textures.request_time", time.Since(start))
|
|
|
|
return result, err
|
|
}
|