redis

package
v0.0.0-...-ebb332d Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Confirmation = 1
	Message      = 2
)
View Source
const (
	RedisConnectionTimeoutPeriod = time.Second * 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSubClient

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

func NewPubSubClient

func NewPubSubClient(url string, channel chan RedisPubSubReply, redisConnection RedisConnection) (*PubSubClient, error)

func (*PubSubClient) Close

func (client *PubSubClient) Close()

func (*PubSubClient) Start

func (client *PubSubClient) Start(key string) error

type PubSubReply

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

func (PubSubReply) Channel

func (p PubSubReply) Channel() string

func (PubSubReply) Err

func (p PubSubReply) Err() error

func (PubSubReply) Message

func (p PubSubReply) Message() string

func (PubSubReply) MessageType

func (p PubSubReply) MessageType() int

type Redis

type Redis interface {
	GetConnection(protocol, uri string) (RedisClient, error)
}

type RedisClient

type RedisClient interface {
	ClosePool()
	SentinelGetMaster(cluster string) (structures.MasterAddress, error)
	SentinelSentinels(cluster string) ([]structures.SentinelInfo, error)
	SentinelMasters() ([]structures.MasterInfo, error)
	Ping() error
	PubSub() (*client.PubSub, error)
}

type RedisConnection

type RedisConnection struct{}

func (RedisConnection) GetConnection

func (RedisConnection) GetConnection(protocol, uri string) (RedisClient, error)

type RedisPubSubReply

type RedisPubSubReply interface {
	Err() error
	Message() string
	Channel() string
	MessageType() int
}

func NewRedisPubSubReply

func NewRedisPubSubReply(message []string, err error) RedisPubSubReply

type SentinelClient

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

func NewSentinelClient

func NewSentinelClient(sentinel types.Sentinel, redisConnection RedisConnection) (*SentinelClient, error)

func (*SentinelClient) Close

func (m *SentinelClient) Close()

func (*SentinelClient) DiscoverMasterForCluster

func (m *SentinelClient) DiscoverMasterForCluster(clusterName string) (*types.MasterDetails, error)

func (*SentinelClient) FindConnectedSentinels

func (client *SentinelClient) FindConnectedSentinels(clustername string) ([]types.Sentinel, error)

func (*SentinelClient) FindKnownClusters

func (client *SentinelClient) FindKnownClusters() ([]string, error)

func (*SentinelClient) Ping

func (m *SentinelClient) Ping() error

Jump to

Keyboard shortcuts

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