redis

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_TYPE_SIMPLE = iota
	CONFIG_TYPE_ETCD
)

Variables

View Source
var DefaultConfiger = NewSimpleConfiger()
View Source
var DefaultInstanceManager = NewInstanceManager()
View Source
var RedisNil = fmt.Sprintf("redis: nil")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, namespace string) (*Client, error)

func (*Client) Close

func (m *Client) Close() error

func (*Client) Del

func (m *Client) Del(keys ...string) *redis.IntCmd

func (*Client) Get

func (m *Client) Get(key string) *redis.StringCmd

func (*Client) Incr

func (m *Client) Incr(key string) *redis.IntCmd

func (*Client) Set

func (m *Client) Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd

func (*Client) SetNX

func (m *Client) SetNX(key string, value interface{}, expiration time.Duration) *redis.BoolCmd

type Config

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

type Configer

type Configer interface {
	GetConfig(ctx context.Context, namespace string) *Config
}

func NewConfiger

func NewConfiger(configType int) (Configer, error)

func NewEtcdConfiger

func NewEtcdConfiger() Configer

func NewSimpleConfiger

func NewSimpleConfiger() Configer

type EtcdConfig

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

func (*EtcdConfig) GetConfig

func (m *EtcdConfig) GetConfig(ctx context.Context, namespace string) *Config

type InstanceManager

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

func NewInstanceManager

func NewInstanceManager() *InstanceManager

func (*InstanceManager) Close

func (m *InstanceManager) Close()

func (*InstanceManager) GetInstance

func (m *InstanceManager) GetInstance(ctx context.Context, namespace string) *Client

type SimpleConfig

type SimpleConfig struct {
}

func (*SimpleConfig) GetConfig

func (m *SimpleConfig) GetConfig(ctx context.Context, namespace string) *Config

Jump to

Keyboard shortcuts

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