cacher

package
v2.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AerospikeCacher

type AerospikeCacher struct {
	// contains filtered or unexported fields
}

func InitAerospikeCacher

func InitAerospikeCacher() *AerospikeCacher

func (*AerospikeCacher) Connect

func (ac *AerospikeCacher) Connect(url string) error

func (*AerospikeCacher) Delete

func (ac *AerospikeCacher) Delete(key string) (bool, error)

func (*AerospikeCacher) Expire

func (ac *AerospikeCacher) Expire(key string, exp time.Duration) error

func (*AerospikeCacher) ExpireTime

func (ac *AerospikeCacher) ExpireTime(key string) (time.Duration, error)

func (*AerospikeCacher) Flush

func (ac *AerospikeCacher) Flush() error

func (*AerospikeCacher) Get

func (ac *AerospikeCacher) Get(key string) ([]byte, error)

func (*AerospikeCacher) Has

func (ac *AerospikeCacher) Has(key string) (bool, error)

func (*AerospikeCacher) Set

func (ac *AerospikeCacher) Set(key string, val []byte, exp time.Duration) error

type Cacher

type Cacher interface {
	Connect(url string) error

	Set(key string, val []byte, exp time.Duration) error
	Has(key string) (bool, error)
	Get(key string) ([]byte, error)

	Expire(key string, exp time.Duration) error
	ExpireTime(key string) (time.Duration, error)

	Delete(key string) (bool, error)
	Flush() error
}

type MemcachedCacher

type MemcachedCacher struct {
	// contains filtered or unexported fields
}

func InitMemcachedCacher

func InitMemcachedCacher() *MemcachedCacher

func (*MemcachedCacher) Connect

func (mc *MemcachedCacher) Connect(url string) error

func (*MemcachedCacher) Delete

func (mc *MemcachedCacher) Delete(key string) (bool, error)

func (*MemcachedCacher) Expire

func (mc *MemcachedCacher) Expire(key string, exp time.Duration) error

func (*MemcachedCacher) ExpireTime

func (mc *MemcachedCacher) ExpireTime(key string) (time.Duration, error)

func (*MemcachedCacher) Flush

func (mc *MemcachedCacher) Flush() error

func (*MemcachedCacher) Get

func (mc *MemcachedCacher) Get(key string) ([]byte, error)

func (*MemcachedCacher) Has

func (mc *MemcachedCacher) Has(key string) (bool, error)

func (*MemcachedCacher) Set

func (mc *MemcachedCacher) Set(key string, val []byte, exp time.Duration) error

type RedisCacher

type RedisCacher struct {
	// contains filtered or unexported fields
}

func InitRedisCacher

func InitRedisCacher() *RedisCacher

func (*RedisCacher) Connect

func (rc *RedisCacher) Connect(url string) error

func (*RedisCacher) Delete

func (rc *RedisCacher) Delete(key string) (bool, error)

func (*RedisCacher) Expire

func (rc *RedisCacher) Expire(key string, exp time.Duration) error

func (*RedisCacher) ExpireTime

func (rc *RedisCacher) ExpireTime(key string) (time.Duration, error)

func (*RedisCacher) Flush

func (rc *RedisCacher) Flush() error

func (*RedisCacher) Get

func (rc *RedisCacher) Get(key string) ([]byte, error)

func (*RedisCacher) Has

func (rc *RedisCacher) Has(key string) (bool, error)

func (*RedisCacher) Set

func (rc *RedisCacher) Set(key string, val []byte, exp time.Duration) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL