proxy

package
v0.0.0-...-a9a2a47 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Addr                 string   `json:"addr"`
	AddrNotify           string   `json:"addrNotify"`
	Advertise_AddrNotify string   `json:"advertise_addrNotify"`
	WatcherHeartbeatSec  int      `json:"watcherHeartbeatSec"`
	PDAddrs              []string `json:"pdAddrs"`
	MaxRetries           int      `json:"maxRetries"`
	RetryDuration        int64    `json:"retryDuration"`
	WorkerCount          uint64   `json:"workerCount"`
	SupportCMDs          []string `json:"supportCMDs"`

	// xiaoxiao : set timeout time
	Timeout int64 `json:"timeout"`
	// xiaoxiao : enable Follower Read
	EnableFollowerRead bool     `json:"enableFollowerRead"`
	ReadHandleCMDs     []string `json:"readhandles"`
}

Cfg returns cfg for proxy

func GetCfg

func GetCfg() *Cfg

GetCfg get cfg from command

type RedisProxy

type RedisProxy struct {
	sync.RWMutex

	// xiaoxiao :
	ReadHandleCMDs     map[string]struct{}
	EnableFollowerRead bool
	// contains filtered or unexported fields
}

RedisProxy is a redis proxy

func NewRedisProxy

func NewRedisProxy(cfg *Cfg) *RedisProxy

NewRedisProxy returns a redisp proxy

func (*RedisProxy) Start

func (p *RedisProxy) Start() error

Start starts the proxy

func (*RedisProxy) Stop

func (p *RedisProxy) Stop()

Stop stop the proxy

Jump to

Keyboard shortcuts

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