redis

package
v0.0.5-0...-8e55a6f Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_redis_redis_proto protoreflect.FileDescriptor

Functions

func NewRedisClient

func NewRedisClient(r *redis.UniversalOptions) redis.UniversalClient

func ResolveRedisEndpointOrDefault

func ResolveRedisEndpointOrDefault(endpoints map[string]*Config, key string) (*redis.UniversalOptions, error)

Types

type Config

type Config struct {
	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,oneof" json:"read_timeout,omitempty"`
	WriteTimeout    *durationpb.Duration    `protobuf:"bytes,4,opt,name=write_timeout,json=writeTimeout,proto3,oneof" json:"write_timeout,omitempty"`
	Username        *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=username,proto3,oneof" json:"username,omitempty"`
	Password        *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=password,proto3,oneof" json:"password,omitempty"`
	Db              *wrapperspb.Int32Value  `protobuf:"bytes,7,opt,name=db,proto3,oneof" json:"db,omitempty"`
	MaxRetries      *wrapperspb.Int32Value  `protobuf:"bytes,8,opt,name=max_retries,json=maxRetries,proto3,oneof" json:"max_retries,omitempty"`
	MinRetryBackoff *durationpb.Duration    `protobuf:"bytes,9,opt,name=min_retry_backoff,json=minRetryBackoff,proto3,oneof" json:"min_retry_backoff,omitempty"`
	MaxRetryBackoff *durationpb.Duration    `protobuf:"bytes,10,opt,name=max_retry_backoff,json=maxRetryBackoff,proto3,oneof" json:"max_retry_backoff,omitempty"`
	DialTimeout     *durationpb.Duration    `protobuf:"bytes,11,opt,name=dial_timeout,json=dialTimeout,proto3,oneof" json:"dial_timeout,omitempty"`
	MasterName      *string                 `protobuf:"bytes,12,opt,name=master_name,json=masterName,proto3,oneof" json:"master_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAddrs

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

func (*Config) GetDb

func (x *Config) GetDb() *wrapperspb.Int32Value

func (*Config) GetDialTimeout

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

func (*Config) GetMasterName

func (x *Config) GetMasterName() string

func (*Config) GetMaxRetries

func (x *Config) GetMaxRetries() *wrapperspb.Int32Value

func (*Config) GetMaxRetryBackoff

func (x *Config) GetMaxRetryBackoff() *durationpb.Duration

func (*Config) GetMinRetryBackoff

func (x *Config) GetMinRetryBackoff() *durationpb.Duration

func (*Config) GetPassword

func (x *Config) GetPassword() *wrapperspb.StringValue

func (*Config) GetReadTimeout

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

func (*Config) GetUsername

func (x *Config) GetUsername() *wrapperspb.StringValue

func (*Config) GetWriteTimeout

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

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

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

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) Validate

func (m *Config) Validate() error

Validate checks the field values on Config 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 (*Config) ValidateAll

func (m *Config) ValidateAll() error

ValidateAll checks the field values on Config 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 ConfigMultiError, or nil if none found.

type ConfigMultiError

type ConfigMultiError []error

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

func (ConfigMultiError) AllErrors

func (m ConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConfigMultiError) Error

func (m ConfigMultiError) Error() string

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

type ConfigValidationError

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

ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.

func (ConfigValidationError) Cause

func (e ConfigValidationError) Cause() error

Cause function returns cause value.

func (ConfigValidationError) Error

func (e ConfigValidationError) Error() string

Error satisfies the builtin error interface

func (ConfigValidationError) ErrorName

func (e ConfigValidationError) ErrorName() string

ErrorName returns error name.

func (ConfigValidationError) Field

func (e ConfigValidationError) Field() string

Field function returns field value.

func (ConfigValidationError) Key

func (e ConfigValidationError) Key() bool

Key function returns key value.

func (ConfigValidationError) Reason

func (e ConfigValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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