standalone

package module
v0.0.0-...-1054a5b Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 19 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

xdis-standalone

resp cmd service standalone mode

Documentation

Index

Constants

View Source
const (
	PONG  = redcon.SimpleString("PONG")
	OK    = redcon.SimpleString("OK")
	NOKEY = redcon.SimpleString("NOKEY")
)
View Source
const (
	GB uint64 = 1024 * 1024 * 1024
	MB uint64 = 1024 * 1024
	KB uint64 = 1024
)

Variables

View Source
var (
	ErrNoops          = errors.New(":)")
	ErrNoInitRespConn = errors.New("not init resp conn")

	ErrNotAuthenticated      = errors.New("ERR not authenticated")
	ErrAuthenticationFailure = errors.New("ERR authentication failure")
	ErrCmdParams             = errors.New("ERR wrong number of arguments")
	ErrValue                 = errors.New("ERR value is not an integer or out of range")
	ErrSyntax                = errors.New("ERR syntax error")

	ErrProtocalVer  = errors.New("ERR Protocol version is not an integer or out of range")
	ErrUnsupportVer = errors.New("NOPROTO unsupported protocol version")
	ErrNOPwd        = errors.New("ERR Client sent AUTH, but no password is set")
	ErrInvalidPwd   = errors.New("ERR invalid password")
)
View Source
var (
	Delims = []byte("\r\n")
)

Functions

func TTLmsToExpireAt

func TTLmsToExpireAt(ttlms int64) (int64, bool)

Types

type CtxKey

type CtxKey int
const (
	RespCmdCtxKey CtxKey = iota
)

type OnAccept

type OnAccept func(conn redcon.Conn) bool

type OnClosed

type OnClosed func(conn redcon.Conn, err error)

type RespCmdConn

type RespCmdConn struct {
	*driver.RespConnBase

	redcon.Conn
	// contains filtered or unexported fields
}

func (*RespCmdConn) Close

func (c *RespCmdConn) Close() error

func (*RespCmdConn) Closed

func (c *RespCmdConn) Closed() bool

func (*RespCmdConn) DoCmd

func (c *RespCmdConn) DoCmd(ctx context.Context, cmd string, cmdParams [][]byte) (res interface{}, err error)

func (*RespCmdConn) GetRemoteAddr

func (c *RespCmdConn) GetRemoteAddr() string

func (*RespCmdConn) SetRedConn

func (c *RespCmdConn) SetRedConn(redConn redcon.Conn)

type RespCmdService

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

func New

func (*RespCmdService) AddRespCmdConn

func (s *RespCmdService) AddRespCmdConn(c driver.IRespConn)

func (*RespCmdService) Close

func (s *RespCmdService) Close() (err error)

func (*RespCmdService) CloseAllRespCmdConnect

func (s *RespCmdService) CloseAllRespCmdConnect()

func (*RespCmdService) DelRespCmdConn

func (s *RespCmdService) DelRespCmdConn(c driver.IRespConn)

func (*RespCmdService) InfoCmd

func (s *RespCmdService) InfoCmd(conn redcon.Conn, cmd redcon.Command)

InfoCmd srv info to dump

func (*RespCmdService) InitRespConn

func (s *RespCmdService) InitRespConn(ctx context.Context, dbIdx int) driver.IRespConn

func (*RespCmdService) Name

func (*RespCmdService) OnAccept

func (s *RespCmdService) OnAccept(conn redcon.Conn) bool

func (*RespCmdService) OnClosed

func (s *RespCmdService) OnClosed(conn redcon.Conn, err error)

func (*RespCmdService) PublishCmd

func (s *RespCmdService) PublishCmd(conn redcon.Conn, cmd redcon.Command)

PublishCmd pub to all pub/sub subscribers and return the number of messages that were sent.

func (*RespCmdService) QuitCmd

func (s *RespCmdService) QuitCmd(conn redcon.Conn, cmd redcon.Command)

QuitCmd connect is closed by srv

func (*RespCmdService) RegisterRespCmdConnHandle

func (s *RespCmdService) RegisterRespCmdConnHandle()

func (*RespCmdService) RespCmdConnectNum

func (s *RespCmdService) RespCmdConnectNum() int

func (*RespCmdService) SetOnAccept

func (s *RespCmdService) SetOnAccept(onAccept OnAccept)

func (*RespCmdService) SetOnClosed

func (s *RespCmdService) SetOnClosed(onClosed OnClosed)

func (*RespCmdService) SetRegisteredCmdHandles

func (s *RespCmdService) SetRegisteredCmdHandles(handles map[string]driver.CmdHandle)

func (*RespCmdService) SetSrvInfo

func (s *RespCmdService) SetSrvInfo(info driver.ISrvInfo)

func (*RespCmdService) SetStorager

func (s *RespCmdService) SetStorager(store driver.IStorager)

func (*RespCmdService) Start

func (s *RespCmdService) Start(ctx context.Context) (err error)

func (*RespCmdService) SubscribeCmd

func (s *RespCmdService) SubscribeCmd(conn redcon.Conn, cmd redcon.Command)

Subscribe sub from a pub/sub channel. The `Psubscribe` and `Subscribe` operations will detach the connection from the event handler and manage all network I/O for this connection in the background.

type SrvInfo

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

func NewSrvInfo

func NewSrvInfo(srv *RespCmdService) (srvInfo *SrvInfo)

func (*SrvInfo) DumpBytes

func (m *SrvInfo) DumpBytes(name driver.DumpSrvInfoName) []byte

func (*SrvInfo) DumpGCStats

func (m *SrvInfo) DumpGCStats(w io.Writer)

func (*SrvInfo) DumpKeySpace

func (m *SrvInfo) DumpKeySpace(w io.Writer)

# Keyspace db0:keys=1,expires=0,avg_ttl=0

func (*SrvInfo) DumpKeySpaceNoStats

func (m *SrvInfo) DumpKeySpaceNoStats(w io.Writer)

func (*SrvInfo) DumpMemory

func (m *SrvInfo) DumpMemory(w io.Writer)

func (*SrvInfo) DumpPairs

func (m *SrvInfo) DumpPairs(w io.Writer, pairs ...driver.InfoPair)

func (*SrvInfo) DumpServer

func (m *SrvInfo) DumpServer(w io.Writer)

func (*SrvInfo) DumpStorageStats

func (m *SrvInfo) DumpStorageStats(w io.Writer)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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