backends

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendInterface

type BackendInterface interface {
	SetResult(result message.Result, exTime int) error
	GetResult(key string) (message.Result, error)
	// 调用Activate后才真正建立连接
	Activate()
	SetPoolSize(int)
	GetPoolSize() int
}

type MemCacheBackend

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

func NewMemCacheBackend

func NewMemCacheBackend(host, port string, poolSize int) MemCacheBackend

func (*MemCacheBackend) Activate

func (r *MemCacheBackend) Activate()

func (*MemCacheBackend) GetPoolSize

func (r *MemCacheBackend) GetPoolSize() int

func (*MemCacheBackend) GetResult

func (r *MemCacheBackend) GetResult(key string) (message.Result, error)

func (*MemCacheBackend) SetPoolSize

func (r *MemCacheBackend) SetPoolSize(n int)

func (*MemCacheBackend) SetResult

func (r *MemCacheBackend) SetResult(result message.Result, exTime int) error

type MongoBackend

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

func NewMongoBackend

func NewMongoBackend(host, port, user, password, db, collection string) MongoBackend

func (*MongoBackend) Activate

func (r *MongoBackend) Activate()

func (*MongoBackend) GetPoolSize

func (r *MongoBackend) GetPoolSize() int

func (*MongoBackend) GetResult

func (r *MongoBackend) GetResult(key string) (message.Result, error)

func (*MongoBackend) SetPoolSize

func (r *MongoBackend) SetPoolSize(n int)

func (*MongoBackend) SetResult

func (r *MongoBackend) SetResult(result message.Result, exTime int) error

type RedisBackend

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

func NewRedisBackend

func NewRedisBackend(host string, port string, password string, db int, poolSize int) RedisBackend

func (*RedisBackend) Activate

func (r *RedisBackend) Activate()

func (*RedisBackend) GetPoolSize

func (r *RedisBackend) GetPoolSize() int

func (*RedisBackend) GetResult

func (r *RedisBackend) GetResult(key string) (message.Result, error)

func (*RedisBackend) SetPoolSize

func (r *RedisBackend) SetPoolSize(n int)

func (*RedisBackend) SetResult

func (r *RedisBackend) SetResult(result message.Result, exTime int) error

Jump to

Keyboard shortcuts

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