add constructor to allservers package
This commit is contained in:
parent
e9db0f1975
commit
ba26badae6
|
@ -22,6 +22,10 @@ type allServersCache struct {
|
|||
client redis.UniversalClient
|
||||
}
|
||||
|
||||
func New(client redis.UniversalClient) AllServersCache {
|
||||
return &allServersCache{client}
|
||||
}
|
||||
|
||||
func (c *allServersCache) Get() ([]*models.Server, bool) {
|
||||
sJSON, err := c.client.Get(context.Background(), key).Result()
|
||||
if sJSON == "" || err != nil {
|
||||
|
|
Reference in New Issue