redis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const KeepTTL = redis.KeepTTL

Variables

View Source
var File_store_redis_conf_proto protoreflect.FileDescriptor

Functions

func NewRedisTracingHook

func NewRedisTracingHook(debug bool) *tracingHook

func NewSpanContext

func NewSpanContext(ctx context.Context, s trace.Span) context.Context

func SpanFromContext

func SpanFromContext(ctx context.Context) (s trace.Span, ok bool)

SpanFromContext returns the Transport value stored in ctx, if any.

Types

type Client

type Client struct {
	redis.Client
}

func New

func New(c *Conf) *Client

type ClusterClient

type ClusterClient struct {
	redis.ClusterClient
}

func NewCluster

func NewCluster(c *Conf) *ClusterClient

type Conf

type Conf struct {

	// string network = 1;
	Addrs         []string             `protobuf:"bytes,2,rep,name=addrs,proto3" json:"addrs,omitempty"`
	ReadTimeout   *durationpb.Duration `protobuf:"bytes,3,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"`
	WriteTimeout  *durationpb.Duration `protobuf:"bytes,4,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"`
	DialTimeout   *durationpb.Duration `protobuf:"bytes,5,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"`
	ExpireTimeout *durationpb.Duration `protobuf:"bytes,6,opt,name=expire_timeout,json=expireTimeout,proto3" json:"expire_timeout,omitempty"`
	Username      string               `protobuf:"bytes,7,opt,name=username,proto3" json:"username,omitempty"`
	Password      string               `protobuf:"bytes,8,opt,name=password,proto3" json:"password,omitempty"`
	Db            int32                `protobuf:"varint,9,opt,name=db,proto3" json:"db,omitempty"`
	Tls           *Tls                 `protobuf:"bytes,10,opt,name=tls,proto3" json:"tls,omitempty"`
	Debug         bool                 `protobuf:"varint,11,opt,name=debug,proto3" json:"debug,omitempty"`
	PoolSize      int32                `protobuf:"varint,12,opt,name=poolSize,proto3" json:"poolSize,omitempty"`
	// contains filtered or unexported fields
}

func (*Conf) Descriptor deprecated

func (*Conf) Descriptor() ([]byte, []int)

Deprecated: Use Conf.ProtoReflect.Descriptor instead.

func (*Conf) GetAddrs

func (x *Conf) GetAddrs() []string

func (*Conf) GetDb

func (x *Conf) GetDb() int32

func (*Conf) GetDebug

func (x *Conf) GetDebug() bool

func (*Conf) GetDialTimeout

func (x *Conf) GetDialTimeout() *durationpb.Duration

func (*Conf) GetExpireTimeout

func (x *Conf) GetExpireTimeout() *durationpb.Duration

func (*Conf) GetPassword

func (x *Conf) GetPassword() string

func (*Conf) GetPoolSize

func (x *Conf) GetPoolSize() int32

func (*Conf) GetReadTimeout

func (x *Conf) GetReadTimeout() *durationpb.Duration

func (*Conf) GetTls

func (x *Conf) GetTls() *Tls

func (*Conf) GetUsername

func (x *Conf) GetUsername() string

func (*Conf) GetWriteTimeout

func (x *Conf) GetWriteTimeout() *durationpb.Duration

func (*Conf) ProtoMessage

func (*Conf) ProtoMessage()

func (*Conf) ProtoReflect

func (x *Conf) ProtoReflect() protoreflect.Message

func (*Conf) Reset

func (x *Conf) Reset()

func (*Conf) String

func (x *Conf) String() string

func (*Conf) Validate

func (m *Conf) Validate() error

Validate checks the field values on Conf with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Conf) ValidateAll

func (m *Conf) ValidateAll() error

ValidateAll checks the field values on Conf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfMultiError, or nil if none found.

type ConfMultiError

type ConfMultiError []error

ConfMultiError is an error wrapping multiple validation errors returned by Conf.ValidateAll() if the designated constraints aren't met.

func (ConfMultiError) AllErrors

func (m ConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConfMultiError) Error

func (m ConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ConfValidationError

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

ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.

func (ConfValidationError) Cause

func (e ConfValidationError) Cause() error

Cause function returns cause value.

func (ConfValidationError) Error

func (e ConfValidationError) Error() string

Error satisfies the builtin error interface

func (ConfValidationError) ErrorName

func (e ConfValidationError) ErrorName() string

ErrorName returns error name.

func (ConfValidationError) Field

func (e ConfValidationError) Field() string

Field function returns field value.

func (ConfValidationError) Key

func (e ConfValidationError) Key() bool

Key function returns key value.

func (ConfValidationError) Reason

func (e ConfValidationError) Reason() string

Reason function returns reason value.

type Logger

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

func NewLogger

func NewLogger() *Logger

func (Logger) Enabled

func (l Logger) Enabled(lvl zapcore.Level) bool

func (Logger) Printf

func (l Logger) Printf(ctx context.Context, format string, v ...interface{})

type Pipeliner

type Pipeliner = redis.Pipeliner

type RedisTextMapCarrier

type RedisTextMapCarrier struct {
}

func (*RedisTextMapCarrier) Get

func (carrier *RedisTextMapCarrier) Get(key string) string

Get returns the value associated with the passed key.

func (*RedisTextMapCarrier) Keys

func (carrier *RedisTextMapCarrier) Keys() []string

Keys lists the keys stored in this carrier.

func (*RedisTextMapCarrier) Set

func (carrier *RedisTextMapCarrier) Set(key string, value string)

Set stores the key-value pair.

type Script

type Script = redis.Script

func NewScript

func NewScript(src string) *Script

type StringStringMapCmd

type StringStringMapCmd = redis.StringStringMapCmd

type Tls

type Tls struct {
	InsecureSkipVerify bool `protobuf:"varint,1,opt,name=insecureSkipVerify,proto3" json:"insecureSkipVerify,omitempty"`
	// contains filtered or unexported fields
}

func (*Tls) Descriptor deprecated

func (*Tls) Descriptor() ([]byte, []int)

Deprecated: Use Tls.ProtoReflect.Descriptor instead.

func (*Tls) GetInsecureSkipVerify

func (x *Tls) GetInsecureSkipVerify() bool

func (*Tls) ProtoMessage

func (*Tls) ProtoMessage()

func (*Tls) ProtoReflect

func (x *Tls) ProtoReflect() protoreflect.Message

func (*Tls) Reset

func (x *Tls) Reset()

func (*Tls) String

func (x *Tls) String() string

func (*Tls) Validate

func (m *Tls) Validate() error

Validate checks the field values on Tls with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Tls) ValidateAll

func (m *Tls) ValidateAll() error

ValidateAll checks the field values on Tls with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TlsMultiError, or nil if none found.

type TlsMultiError

type TlsMultiError []error

TlsMultiError is an error wrapping multiple validation errors returned by Tls.ValidateAll() if the designated constraints aren't met.

func (TlsMultiError) AllErrors

func (m TlsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TlsMultiError) Error

func (m TlsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type TlsValidationError

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

TlsValidationError is the validation error returned by Tls.Validate if the designated constraints aren't met.

func (TlsValidationError) Cause

func (e TlsValidationError) Cause() error

Cause function returns cause value.

func (TlsValidationError) Error

func (e TlsValidationError) Error() string

Error satisfies the builtin error interface

func (TlsValidationError) ErrorName

func (e TlsValidationError) ErrorName() string

ErrorName returns error name.

func (TlsValidationError) Field

func (e TlsValidationError) Field() string

Field function returns field value.

func (TlsValidationError) Key

func (e TlsValidationError) Key() bool

Key function returns key value.

func (TlsValidationError) Reason

func (e TlsValidationError) Reason() string

Reason function returns reason value.

type XAddArgs

type XAddArgs = redis.XAddArgs

type XReadGroupArgs

type XReadGroupArgs = redis.XReadGroupArgs

type Z

type Z = redis.Z

type ZAddArgs

type ZAddArgs = redis.ZAddArgs

type ZRangeBy

type ZRangeBy = redis.ZRangeBy

Jump to

Keyboard shortcuts

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