summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/kv/boltdb/plugin_unit_test.go8
-rw-r--r--plugins/kv/memcached/plugin.go16
-rw-r--r--plugins/kv/memcached/plugin_unit_test.go10
-rw-r--r--plugins/kv/memory/plugin_unit_test.go8
-rw-r--r--plugins/server/config.go2
5 files changed, 22 insertions, 22 deletions
diff --git a/plugins/kv/boltdb/plugin_unit_test.go b/plugins/kv/boltdb/plugin_unit_test.go
index 2459e493..fa12db8c 100644
--- a/plugins/kv/boltdb/plugin_unit_test.go
+++ b/plugins/kv/boltdb/plugin_unit_test.go
@@ -164,7 +164,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// concurrently set the keys
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.Lock()
// set is writable transaction
// it should stop readable
@@ -184,7 +184,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// should be no errors
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.RLock()
v, err = s.Has("key")
assert.NoError(t, err)
@@ -197,7 +197,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// should be no errors
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.Lock()
err = s.Delete("key" + strconv.Itoa(i))
assert.NoError(t, err)
@@ -453,7 +453,7 @@ func TestStorage_MExpire_TTL(t *testing.T) {
}
assert.NoError(t, s.MExpire(i1, i2))
- time.Sleep(time.Second * 6)
+ time.Sleep(time.Second * 7)
// ensure that storage is clean
v, err = s.Has("key", "key2")
diff --git a/plugins/kv/memcached/plugin.go b/plugins/kv/memcached/plugin.go
index f5111c04..05159b33 100644
--- a/plugins/kv/memcached/plugin.go
+++ b/plugins/kv/memcached/plugin.go
@@ -68,7 +68,7 @@ func (s *Plugin) Name() string {
}
// Has checks the key for existence
-func (s Plugin) Has(keys ...string) (map[string]bool, error) {
+func (s *Plugin) Has(keys ...string) (map[string]bool, error) {
const op = errors.Op("memcached Has")
if keys == nil {
return nil, errors.E(op, errors.NoKeys)
@@ -93,7 +93,7 @@ func (s Plugin) Has(keys ...string) (map[string]bool, error) {
// Get gets the item for the given key. ErrCacheMiss is returned for a
// memcache cache miss. The key must be at most 250 bytes in length.
-func (s Plugin) Get(key string) ([]byte, error) {
+func (s *Plugin) Get(key string) ([]byte, error) {
const op = errors.Op("memcached Get")
// to get cases like " "
keyTrimmed := strings.TrimSpace(key)
@@ -115,7 +115,7 @@ func (s Plugin) Get(key string) ([]byte, error) {
// return map with key -- string
// and map value as value -- []byte
-func (s Plugin) MGet(keys ...string) (map[string]interface{}, error) {
+func (s *Plugin) MGet(keys ...string) (map[string]interface{}, error) {
const op = errors.Op("memcached MGet")
if keys == nil {
return nil, errors.E(op, errors.NoKeys)
@@ -150,7 +150,7 @@ func (s Plugin) MGet(keys ...string) (map[string]interface{}, error) {
// Expiration is the cache expiration time, in seconds: either a relative
// time from now (up to 1 month), or an absolute Unix epoch time.
// Zero means the Item has no expiration time.
-func (s Plugin) Set(items ...kv.Item) error {
+func (s *Plugin) Set(items ...kv.Item) error {
const op = errors.Op("memcached Set")
if items == nil {
return errors.E(op, errors.NoKeys)
@@ -191,7 +191,7 @@ func (s Plugin) Set(items ...kv.Item) error {
// Expiration is the cache expiration time, in seconds: either a relative
// time from now (up to 1 month), or an absolute Unix epoch time.
// Zero means the Item has no expiration time.
-func (s Plugin) MExpire(items ...kv.Item) error {
+func (s *Plugin) MExpire(items ...kv.Item) error {
const op = errors.Op("memcached MExpire")
for i := range items {
if items[i].TTL == "" || strings.TrimSpace(items[i].Key) == "" {
@@ -218,12 +218,12 @@ func (s Plugin) MExpire(items ...kv.Item) error {
}
// return time in seconds (int32) for a given keys
-func (s Plugin) TTL(keys ...string) (map[string]interface{}, error) {
+func (s *Plugin) TTL(keys ...string) (map[string]interface{}, error) {
const op = errors.Op("memcached HTTLas")
return nil, errors.E(op, errors.Str("not valid request for memcached, see https://github.com/memcached/memcached/issues/239"))
}
-func (s Plugin) Delete(keys ...string) error {
+func (s *Plugin) Delete(keys ...string) error {
const op = errors.Op("memcached Has")
if keys == nil {
return errors.E(op, errors.NoKeys)
@@ -247,6 +247,6 @@ func (s Plugin) Delete(keys ...string) error {
return nil
}
-func (s Plugin) Close() error {
+func (s *Plugin) Close() error {
return nil
}
diff --git a/plugins/kv/memcached/plugin_unit_test.go b/plugins/kv/memcached/plugin_unit_test.go
index 3d37748b..31423627 100644
--- a/plugins/kv/memcached/plugin_unit_test.go
+++ b/plugins/kv/memcached/plugin_unit_test.go
@@ -245,7 +245,7 @@ func TestStorage_MExpire_TTL(t *testing.T) {
}
assert.NoError(t, s.MExpire(i1, i2))
- time.Sleep(time.Second * 6)
+ time.Sleep(time.Second * 7)
// ensure that storage is clean
v, err = s.Has("key", "key2")
@@ -341,7 +341,7 @@ func TestStorage_SetExpire_TTL(t *testing.T) {
TTL: nowPlusFive,
}))
- time.Sleep(time.Second * 6)
+ time.Sleep(time.Second * 7)
// ensure that storage is clean
v, err = s.Has("key", "key2")
@@ -387,7 +387,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// concurrently set the keys
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.Lock()
// set is writable transaction
// it should stop readable
@@ -407,7 +407,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// should be no errors
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.RLock()
v, err = s.Has("key")
assert.NoError(t, err)
@@ -420,7 +420,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// should be no errors
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.Lock()
err = s.Delete("key" + strconv.Itoa(i))
assert.NoError(t, err)
diff --git a/plugins/kv/memory/plugin_unit_test.go b/plugins/kv/memory/plugin_unit_test.go
index d3b24860..6daa0795 100644
--- a/plugins/kv/memory/plugin_unit_test.go
+++ b/plugins/kv/memory/plugin_unit_test.go
@@ -266,7 +266,7 @@ func TestStorage_MExpire_TTL(t *testing.T) {
}
assert.NoError(t, s.MExpire(i1, i2))
- time.Sleep(time.Second * 6)
+ time.Sleep(time.Second * 7)
// ensure that storage is clean
v, err = s.Has("key", "key2")
@@ -428,7 +428,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// concurrently set the keys
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.Lock()
// set is writable transaction
// it should stop readable
@@ -448,7 +448,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// should be no errors
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.RLock()
v, err = s.Has("key")
assert.NoError(t, err)
@@ -461,7 +461,7 @@ func TestConcurrentReadWriteTransactions(t *testing.T) {
// should be no errors
go func(s kv.Storage) {
defer wg.Done()
- for i := 0; i <= 1000; i++ {
+ for i := 0; i <= 100; i++ {
m.Lock()
err = s.Delete("key" + strconv.Itoa(i))
assert.NoError(t, err)
diff --git a/plugins/server/config.go b/plugins/server/config.go
index 93b19226..92e6780a 100644
--- a/plugins/server/config.go
+++ b/plugins/server/config.go
@@ -23,7 +23,7 @@ type Config struct {
Relay string `mapstructure:"relay"`
// RelayTimeout defines for how long socket factory will be waiting for worker connection. This config section
// must not change on re-configuration. Defaults to 60s.
- RelayTimeout time.Duration `mapstructure:"relayTimeout"`
+ RelayTimeout time.Duration `mapstructure:"relay_timeout"`
} `mapstructure:"server"`
RPC *struct {