service

package
v0.0.0-...-9c01824 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllSentinelsBrokenErr = errors.New("all sentinels unavailable")

Functions

This section is empty.

Types

type DbConnector

type DbConnector struct{}

func (*DbConnector) Listen

func (dc *DbConnector) Listen(localPort int) (net.Listener, error)

type MongoConnector

type MongoConnector struct {
	Username string
	Password string
	// contains filtered or unexported fields
}

func NewMongoBalancer

func NewMongoBalancer(username, password string, addrs []string) *MongoConnector

func (*MongoConnector) CheckHealth

func (m *MongoConnector) CheckHealth(addr string) bool

func (*MongoConnector) ChooseBackEnd

func (m *MongoConnector) ChooseBackEnd() string

type Proxy

type Proxy struct {
	Tracks map[string]track
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy() *Proxy

func (*Proxy) AddConnection

func (p *Proxy) AddConnection(c string, upStream, downStram net.Conn)

func (*Proxy) Close

func (p *Proxy) Close()

func (*Proxy) DeleteConnection

func (p *Proxy) DeleteConnection(c string)

type ProxyBridge

type ProxyBridge struct{}

func (*ProxyBridge) Proxy

func (pb *ProxyBridge) Proxy(clientConn, redisConn net.Conn)

type RedisConnector

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

func NewRedisConnector

func NewRedisConnector(requestTimeout int) *RedisConnector

func (*RedisConnector) Connect

func (rc *RedisConnector) Connect(addr string) (net.Conn, error)

func (*RedisConnector) Ping

func (rc *RedisConnector) Ping(addr string) error

type SentinelConnector

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

func NewSentinelConnector

func NewSentinelConnector(sentinelAddrList []string, requestTimeout int) *SentinelConnector

func (*SentinelConnector) AddSentinelClient

func (sc *SentinelConnector) AddSentinelClient(sentinelAddr string)

func (*SentinelConnector) GetActualRedisAddr

func (sc *SentinelConnector) GetActualRedisAddr(masterName string) (string, error)

Jump to

Keyboard shortcuts

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