Documentation
¶
Index ¶
- Variables
- type PharosCache
- func (rx *PharosCache) CheckConnected(ctx context.Context) error
- func (rx *PharosCache) Close()
- func (rx *PharosCache) Connect(ctx context.Context) error
- func (rx PharosCache) Get(ctx context.Context, key string) ([]byte, error)
- func (rx PharosCache) GetExpire(ctx context.Context, key string, ttl time.Duration) ([]byte, error)
- func (rx PharosCache) GetExpireUnpack(ctx context.Context, key string, ttl time.Duration) ([]byte, error)
- func (rx PharosCache) Pack(data []byte) []byte
- func (rx PharosCache) ServiceName() string
- func (rx PharosCache) SetExpire(ctx context.Context, key string, data []byte, ttl time.Duration) error
- func (rx PharosCache) SetExpirePack(ctx context.Context, key string, data []byte, ttl time.Duration) error
- func (rx PharosCache) UnPack(data []byte) ([]byte, error)
- func (rx *PharosCache) UsedMemory(ctx context.Context) (string, string, string)
- func (rx PharosCache) Version(ctx context.Context) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotFound = errors.New("key not found")
Functions ¶
This section is empty.
Types ¶
type PharosCache ¶
type PharosCache struct {
Endpoint string
// contains filtered or unexported fields
}
func NewPharosCache ¶
func NewPharosCache(endpoint string, logger *zerolog.Logger) (*PharosCache, error)
func (*PharosCache) CheckConnected ¶
func (rx *PharosCache) CheckConnected(ctx context.Context) error
func (*PharosCache) Close ¶
func (rx *PharosCache) Close()
func (PharosCache) GetExpireUnpack ¶
func (PharosCache) Pack ¶
func (rx PharosCache) Pack(data []byte) []byte
func (PharosCache) ServiceName ¶
func (rx PharosCache) ServiceName() string
func (PharosCache) SetExpire ¶
func (rx PharosCache) SetExpire(ctx context.Context, key string, data []byte, ttl time.Duration) error
set key and expire.
func (PharosCache) SetExpirePack ¶
func (*PharosCache) UsedMemory ¶
retrieve memory usage
Click to show internal directories.
Click to hide internal directories.