Resolves #13. Add a config param to completely disable Mojang textures provider

This commit is contained in:
ErickSkrauch
2020-04-06 17:15:40 +03:00
parent 03c5a03c73
commit 092ea3d4e2
6 changed files with 67 additions and 25 deletions

View File

@@ -0,0 +1,12 @@
package mojangtextures
import (
"github.com/elyby/chrly/api/mojang"
)
type NilProvider struct {
}
func (p *NilProvider) GetForUsername(username string) (*mojang.SignedTexturesResponse, error) {
return nil, nil
}

View File

@@ -0,0 +1,14 @@
package mojangtextures
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNilProvider_GetForUsername(t *testing.T) {
provider := &NilProvider{}
result, err := provider.GetForUsername("username")
assert.Nil(t, result)
assert.Nil(t, err)
}