many fixes for lint and context.Context usage (#5)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-03 02:02:32 +03:00
committed by GitHub
parent 40b0870cf8
commit 8a2b122015
44 changed files with 152 additions and 1175 deletions

13
cache/cache.go vendored
View File

@@ -1,24 +1,29 @@
// Package cache is a caching interface
package cache
import "context"
// Cache is an interface for caching
type Cache interface {
// Initialise options
Init(...Option) error
// Get a value
Get(key string) (interface{}, error)
Get(ctx context.Context, key string) (interface{}, error)
// Set a value
Set(key string, val interface{}) error
Set(ctx context.Context, key string, val interface{}) error
// Delete a value
Delete(key string) error
Delete(ctx context.Context, key string) error
// Name of the implementation
String() string
}
// Options struct
type Options struct {
Nodes []string
Nodes []string
Context context.Context
}
// Option func
type Option func(o *Options)
// Nodes sets the nodes for the cache