uredis

package
v0.0.0-...-110c355 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedPool = errors.New("use of closed redis pool")

Functions

This section is empty.

Types

type Client

type Client struct {
	Addr string
	Auth string

	Database int

	LastUse time.Time
	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string, auth string, timeout time.Duration) (*Client, error)

func NewClientNoAuth

func NewClientNoAuth(addr string, timeout time.Duration) (*Client, error)

func (*Client) AddObserver

func (c *Client) AddObserver(raftAddress string, nodeId int) error

func (*Client) AddToSlave

func (c *Client) AddToSlave(raftAddress string, nodeId int) error

func (*Client) AddWitness

func (c *Client) AddWitness(raftAddress string, nodeId int) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) ClusterInfo

func (c *Client) ClusterInfo() (map[string]string, error)

func (*Client) Compact

func (c *Client) Compact(dbType string) error

func (*Client) DeRaft

func (c *Client) DeRaft(token string) error

func (*Client) DebugInfo

func (c *Client) DebugInfo() (map[string]string, error)

func (*Client) DebugInfoFull

func (c *Client) DebugInfoFull() (map[string]string, error)

func (*Client) Do

func (c *Client) Do(cmd string, args ...interface{}) (interface{}, error)

func (*Client) GetClusterMemberShip

func (c *Client) GetClusterMemberShip() (*MembershipV2, error)

func (*Client) GetNodeHostInfo

func (c *Client) GetNodeHostInfo() (string, error)

func (*Client) Info

func (c *Client) Info() (map[string]string, error)

func (*Client) InfoFull

func (c *Client) InfoFull() (map[string]string, error)

func (*Client) LogCompact

func (c *Client) LogCompact() error

func (*Client) MigrateCallback

func (c *Client) MigrateCallback(callback_url string) error

func (*Client) MigrateEnd

func (c *Client) MigrateEnd(slotId int) error

func (*Client) MigrateSlots

func (c *Client) MigrateSlots(slotid int, target string) error

func (*Client) MigrateStatus

func (c *Client) MigrateStatus(slotId int) ([]byte, error)

func (*Client) PromoteMaster

func (c *Client) PromoteMaster() error

func (*Client) ReRaft

func (c *Client) ReRaft(token string, port int) error

func (*Client) Receive

func (c *Client) Receive() (interface{}, error)

func (*Client) RemoveRaftNode

func (c *Client) RemoveRaftNode(nodeId int) error

func (*Client) Role

func (c *Client) Role() (string, error)

func (*Client) Select

func (c *Client) Select(database int) error

func (*Client) SetMaster

func (c *Client) SetMaster(master string) error

func (*Client) ShutDown

func (c *Client) ShutDown() error

func (*Client) Shutdown

func (c *Client) Shutdown() error

func (*Client) SlotsInfo

func (c *Client) SlotsInfo() (map[int]int, error)

type InfoCache

type InfoCache struct {
	Auth string

	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewInfoCache

func NewInfoCache(auth string, timeout time.Duration, pool *Pool) *InfoCache

func (*InfoCache) Get

func (s *InfoCache) Get(addr string, force bool) (info map[string]string)

func (*InfoCache) GetNodeRaftInfo

func (s *InfoCache) GetNodeRaftInfo(addr string, iswitness bool) (*NodeInfo, error)

func (*InfoCache) GetProcessId

func (s *InfoCache) GetProcessId(addr string) string

func (*InfoCache) GetRaftGroupMaster

func (s *InfoCache) GetRaftGroupMaster(groupId int, addrs map[string]string) (string, error)

func (*InfoCache) GetRaftGroupStatusInfo

func (s *InfoCache) GetRaftGroupStatusInfo(groupId int, addrs map[string]string) *RaftGroupStatusInfo

type Membership

type Membership struct {
	// ConfigChangeID is the Raft entry index of the last applied membership
	// change entry.
	ConfigChangeID uint64 `json:"config_changeid"`
	// Nodes is a map of NodeID values to NodeHost Raft addresses for all regular
	// Raft nodes.
	Nodes map[uint64]string `json:"nodes"`
	// Observers is a map of NodeID values to NodeHost Raft addresses for all
	// observers in the Raft cluster.
	Observers map[uint64]string `json:"observers"`
	// Witnesses is a map of NodeID values to NodeHost Raft addrsses for all
	// witnesses in the Raft cluster.
	Witnesses map[uint64]string `json:"witnesses"`
	// Removed is a set of NodeID values that have been removed from the Raft
	// cluster. They are not allowed to be added back to the cluster.
	Removed map[uint64]struct{} `json:"removed"`
}

type MembershipV2

type MembershipV2 struct {
	Info Membership `json:"info"`
}

func (*MembershipV2) CheckNodeIsRemove

func (ms *MembershipV2) CheckNodeIsRemove(nodeId int) bool

func (*MembershipV2) CheckNodeIsUse

func (ms *MembershipV2) CheckNodeIsUse(nodeId int) bool

func (*MembershipV2) Marshal

func (ms *MembershipV2) Marshal() (string, error)

type MigrateSlotAsyncOption

type MigrateSlotAsyncOption struct {
	MaxBulks int
	MaxBytes int
	NumKeys  int
	Timeout  time.Duration
}

type NodeInfo

type NodeInfo struct {
	NodeStatus     bool
	CurrentNodeId  string
	CurrentAddress string
	StartModel     string
	Role           string
	ClusterId      string
	LeaderNodeId   string
	LeaderAddress  string
	ClusterNodes   string
	// contains filtered or unexported fields
}

func (*NodeInfo) Md5

func (nf *NodeInfo) Md5() string

type Pool

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

func NewPool

func NewPool(auth string, timeout time.Duration) *Pool

func (*Pool) Cleanup

func (p *Pool) Cleanup() error

func (*Pool) Close

func (p *Pool) Close() error

func (*Pool) ClusterInfo

func (p *Pool) ClusterInfo(addr string) (map[string]string, error)

func (*Pool) GetClient

func (p *Pool) GetClient(addr string) (*Client, error)

func (*Pool) Info

func (p *Pool) Info(addr string) (map[string]string, error)

func (*Pool) InfoFull

func (p *Pool) InfoFull(addr string) (map[string]string, error)

func (*Pool) PutClient

func (p *Pool) PutClient(c *Client)

type RaftGroupStatusInfo

type RaftGroupStatusInfo struct {
	NodeInfoList map[string]*NodeInfo
	FlagNodeList map[string]bool
	MasterAddr   string
}

Jump to

Keyboard shortcuts

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