Compare commits

..

11 Commits

Author SHA1 Message Date
ErickSkrauch
c25a2f2360 Merge branch 'master' into ely 2019-05-06 17:27:28 +03:00
ErickSkrauch
edc368aa81 Merge branch 'master' into ely 2019-05-02 21:56:04 +03:00
ErickSkrauch
4097e61a02 Merge branch 'master' into ely 2019-05-02 21:08:21 +03:00
ErickSkrauch
26a8628070 Remove faces endpoint 2019-05-02 20:55:50 +03:00
ErickSkrauch
ae0ff91a64 Fix test for signed textures 2019-05-02 20:54:18 +03:00
ErickSkrauch
ab6410ff4a Merge branch 'master' into ely 2019-05-02 20:53:45 +03:00
ErickSkrauch
c7ac890812 Merge branch 'master' into ely 2018-03-19 02:19:14 +03:00
ErickSkrauch
7734f2cbd5 Merge branch 'master' into ely 2018-02-17 01:52:47 +03:00
ErickSkrauch
55b8c12955 Restore Ely documentation link on the 404 page 2018-02-16 21:01:01 +03:00
ErickSkrauch
10ff6f34fb Restore Ely signed textures ely property 2018-02-16 21:01:01 +03:00
ErickSkrauch
31cd75ffa7 Restore Ely faces API 2018-02-16 21:01:01 +03:00
7 changed files with 13 additions and 20 deletions

View File

@@ -4,11 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] - xxxx-xx-xx ## [Unreleased]
## [4.2.2] - 2019-06-19
### Fixed
- GC for in-memory textures cache has not been initialized.
## [4.2.1] - 2019-05-06 ## [4.2.1] - 2019-05-06
### Changed ### Changed
@@ -61,7 +57,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
from the textures link instead. from the textures link instead.
- `hash` field from `POST /api/skins` endpoint. - `hash` field from `POST /api/skins` endpoint.
[Unreleased]: https://github.com/elyby/chrly/compare/4.2.2...HEAD [Unreleased]: https://github.com/elyby/chrly/compare/4.2.1...HEAD
[4.2.2]: https://github.com/elyby/chrly/compare/4.2.1...4.2.2
[4.2.1]: https://github.com/elyby/chrly/compare/4.2.0...4.2.1 [4.2.1]: https://github.com/elyby/chrly/compare/4.2.0...4.2.1
[4.2.0]: https://github.com/elyby/chrly/compare/4.1.1...4.2.0 [4.2.0]: https://github.com/elyby/chrly/compare/4.1.1...4.2.0

View File

@@ -25,11 +25,9 @@ type inMemoryTexturesStorage struct {
} }
func CreateInMemoryTexturesStorage() *inMemoryTexturesStorage { func CreateInMemoryTexturesStorage() *inMemoryTexturesStorage {
storage := &inMemoryTexturesStorage{ return &inMemoryTexturesStorage{
data: make(map[string]*inMemoryItem), data: make(map[string]*inMemoryItem),
} }
return storage
} }
func (s *inMemoryTexturesStorage) Start() { func (s *inMemoryTexturesStorage) Start() {

View File

@@ -51,13 +51,11 @@ var serveCmd = &cobra.Command{
return return
} }
texturesStorage := queue.CreateInMemoryTexturesStorage()
texturesStorage.Start()
mojangTexturesQueue := &queue.JobsQueue{ mojangTexturesQueue := &queue.JobsQueue{
Logger: logger, Logger: logger,
Storage: &queue.SplittedStorage{ Storage: &queue.SplittedStorage{
UuidsStorage: mojangUuidsRepository, UuidsStorage: mojangUuidsRepository,
TexturesStorage: texturesStorage, TexturesStorage: queue.CreateInMemoryTexturesStorage(),
}, },
} }
logger.Info("Mojang's textures queue is successfully initialized") logger.Info("Mojang's textures queue is successfully initialized")

View File

@@ -9,6 +9,7 @@ func (cfg *Config) NotFound(response http.ResponseWriter, request *http.Request)
data, _ := json.Marshal(map[string]string{ data, _ := json.Marshal(map[string]string{
"status": "404", "status": "404",
"message": "Not Found", "message": "Not Found",
"link": "http://docs.ely.by/skin-system.html",
}) })
response.Header().Set("Content-Type", "application/json") response.Header().Set("Content-Type", "application/json")

View File

@@ -22,6 +22,7 @@ func TestConfig_NotFound(t *testing.T) {
response, _ := ioutil.ReadAll(resp.Body) response, _ := ioutil.ReadAll(resp.Body)
assert.JSONEq(`{ assert.JSONEq(`{
"status": "404", "status": "404",
"message": "Not Found" "message": "Not Found",
"link": "http://docs.ely.by/skin-system.html"
}`, string(response)) }`, string(response))
} }

View File

@@ -39,8 +39,8 @@ func (cfg *Config) SignedTextures(response http.ResponseWriter, request *http.Re
} }
responseData.Props = append(responseData.Props, &mojang.Property{ responseData.Props = append(responseData.Props, &mojang.Property{
Name: "chrly", Name: "ely",
Value: "how do you tame a horse in Minecraft?", Value: "but why are you asking?",
}) })
responseJson, _ := json.Marshal(responseData) responseJson, _ := json.Marshal(responseData)

View File

@@ -42,8 +42,8 @@ func TestConfig_SignedTextures(t *testing.T) {
"value": "mocked textures base64" "value": "mocked textures base64"
}, },
{ {
"name": "chrly", "name": "ely",
"value": "how do you tame a horse in Minecraft?" "value": "but why are you asking?"
} }
] ]
}`, string(response)) }`, string(response))
@@ -132,8 +132,8 @@ func TestConfig_SignedTextures(t *testing.T) {
"value": "eyJ0aW1lc3RhbXAiOjE1NTYzOTg1NzIsInByb2ZpbGVJZCI6IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwIiwicHJvZmlsZU5hbWUiOiJtb2NrX3VzZXIiLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly9tb2phbmcvc2tpbi5wbmcifX19" "value": "eyJ0aW1lc3RhbXAiOjE1NTYzOTg1NzIsInByb2ZpbGVJZCI6IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwIiwicHJvZmlsZU5hbWUiOiJtb2NrX3VzZXIiLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly9tb2phbmcvc2tpbi5wbmcifX19"
}, },
{ {
"name": "chrly", "name": "ely",
"value": "how do you tame a horse in Minecraft?" "value": "but why are you asking?"
} }
] ]
}`, string(response)) }`, string(response))