Documentation ¶
Index ¶
- type Cache
- type Client
- func (client *Client) Clean() error
- func (client *Client) Close() error
- func (client *Client) Get(key string) (requests.RPCResponse, error)
- func (client *Client) Requests() ([]requests.RPCRequest, error)
- func (client *Client) Set(key string, request requests.RPCRequest, response requests.RPCResponse) error
- type Error
- type MemoryCache
- func (m *MemoryCache) Clean() error
- func (m *MemoryCache) Close() error
- func (m *MemoryCache) Get(key string) (requests.RPCResponse, error)
- func (m *MemoryCache) Requests() ([]requests.RPCRequest, error)
- func (m *MemoryCache) Set(key string, request requests.RPCRequest, response requests.RPCResponse) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Set(key string, request requests.RPCRequest, response requests.RPCResponse) error Get(key string) (requests.RPCResponse, error) Requests() ([]requests.RPCRequest, error) Close() error Clean() error }
Cache ...
type Client ¶
type Client struct {
*redis.Client
}
Client represents redis client
func NewRedisClient ¶
NewRedisClient creates redis client
func (*Client) Set ¶
func (client *Client) Set(key string, request requests.RPCRequest, response requests.RPCResponse) error
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error for cache package
type MemoryCache ¶
type MemoryCache struct {
*cache.Cache
}
MemoryCache ...
func NewMemoryCache ¶
func NewMemoryCache(defaultExpiration, cleanupInterval time.Duration) *MemoryCache
NewMemoryCache initializes memory cache
func NewMemoryCacheDefault ¶
func NewMemoryCacheDefault() *MemoryCache
NewMemoryCacheDefault initializes memory cache with default parameters
func NewMemoryCacheFromConfig ¶
func NewMemoryCacheFromConfig(config config.MemoryCacheSettings) *MemoryCache
NewMemoryCacheFromConfig initializes memory cache from config
func (*MemoryCache) Get ¶
func (m *MemoryCache) Get(key string) (requests.RPCResponse, error)
Get ...
func (*MemoryCache) Requests ¶
func (m *MemoryCache) Requests() ([]requests.RPCRequest, error)
func (*MemoryCache) Set ¶
func (m *MemoryCache) Set(key string, request requests.RPCRequest, response requests.RPCResponse) error
Set ...
Click to show internal directories.
Click to hide internal directories.