handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionOpen = iota
	TransactionInner
	TransactionClose
)

Variables

View Source
var PipelineSignalEndKey = []byte("🔚")
View Source
var PipelineSignalStartKey = []byte("🔜")
View Source
var TransactionCommands = map[string]int{

	"DISCARD": TransactionClose,
	"EXEC":    TransactionClose,
	"MULTI":   TransactionOpen,
	"UNWATCH": TransactionInner,
	"WATCH":   TransactionOpen,
}
View Source
var UnsupportedCommands = map[string]bool{

	"BLPOP":        true,
	"BRPOP":        true,
	"BRPOPLPUSH":   true,
	"BZPOPMAX":     true,
	"BZPOPMIN":     true,
	"XREAD":        true,
	"XREADGROUP":   true,
	"SUBSCRIBE":    true,
	"UNSUBSCRIBE":  true,
	"WAIT":         true,
	"PUNSUBSCRIBE": true,
	"PSUBSCRIBE":   true,

	"AUTH":   true,
	"SELECT": true,
}

Functions

func CommandConnection

func CommandConnection(log *zap.Logger, sd *statsd.Client, conn net.Conn, address string, readTimeout, writeTimeout time.Duration, id uint64, server *pool.Server, kill chan interface{}, interceptor MessageInterceptor)

func ReadWireMessages

func ReadWireMessages(ctx context.Context, log *zap.Logger, nc net.Conn, address string, id uint64, readTimeout time.Duration, readMin int, checkPipelineSignals bool, close func() error) ([]*redis.Message, error)

func WriteWireMessages

func WriteWireMessages(ctx context.Context, log *zap.Logger, wm []*redis.Message, nc net.Conn, address string, id uint64, writeTimeout time.Duration, wrapPipeline bool, close func() error) error

Types

type MessageInterceptor

type MessageInterceptor func(incomingCmds []string, m []*redis.Message)

Jump to

Keyboard shortcuts

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