Adjust Mojang's queue behavior

This commit is contained in:
ErickSkrauch
2019-05-05 23:06:29 +03:00
parent f3a8af6866
commit 9dde5715f5
8 changed files with 109 additions and 67 deletions

View File

@@ -7,12 +7,12 @@ type UuidsStorage interface {
StoreUuid(username string, uuid string)
}
// nil value can be passed to the storage to indicate that there is no textures
// for uuid and we know about it. Return err only in case, when storage completely
// unable to load any information about textures
type TexturesStorage interface {
// nil can be returned to indicate that there is no textures for uuid
// and we know about it. Return err only in case, when storage completely
// don't know anything about uuid
GetTextures(uuid string) (*mojang.SignedTexturesResponse, error)
StoreTextures(textures *mojang.SignedTexturesResponse)
StoreTextures(uuid string, textures *mojang.SignedTexturesResponse)
}
type Storage interface {
@@ -39,8 +39,8 @@ func (s *SplittedStorage) GetTextures(uuid string) (*mojang.SignedTexturesRespon
return s.TexturesStorage.GetTextures(uuid)
}
func (s *SplittedStorage) StoreTextures(textures *mojang.SignedTexturesResponse) {
s.TexturesStorage.StoreTextures(textures)
func (s *SplittedStorage) StoreTextures(uuid string, textures *mojang.SignedTexturesResponse) {
s.TexturesStorage.StoreTextures(uuid, textures)
}
// This error can be used to indicate, that requested