mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
Resolves #13. Add a config param to completely disable Mojang textures provider
This commit is contained in:
12
mojangtextures/nil_mojang_textures.go
Normal file
12
mojangtextures/nil_mojang_textures.go
Normal 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
|
||||
}
|
14
mojangtextures/nil_mojang_textures_test.go
Normal file
14
mojangtextures/nil_mojang_textures_test.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user