redis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(opts *redis.Options)

func WithAddr

func WithAddr(addr string) Option

func WithDB

func WithDB(db int) Option

func WithDialer

func WithDialer(dialer func(ctx context.Context, network, addr string) (net.Conn, error)) Option

func WithPassword

func WithPassword(password string) Option

func WithReadTimeout

func WithReadTimeout(t time.Duration) Option

func WithTLSConfig

func WithTLSConfig(t *tls.Config) Option

func WithWriteTimeout

func WithWriteTimeout(t time.Duration) Option

type Source

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

Source use redis as datasource

func NewSource

func NewSource(opts ...Option) *Source

NewSource return a redis source getter

func (*Source) Get

func (r *Source) Get(ctx context.Context, key string) ([]byte, error)

Get from redis source

Jump to

Keyboard shortcuts

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