types

package
v0.0.0-...-4b30a6a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlattenHash = StoreType("flatten-hash")
	Serialized  = StoreType("serialized")

	Redigo = ClientType("redigo")
)

Variables

This section is empty.

Functions

func GetName

func GetName(myvar interface{}) string

Types

type ClientType

type ClientType string

type Config

type Config struct {
	DatabaseIdx       int
	PrimaryKey        string
	SuffixScoreSetKey string
	// contains filtered or unexported fields
}

func CreateConfig

func CreateConfig(ops ...ConfigOption) Config

type ConfigOption

type ConfigOption func(*Config)

func DatabaseIdx

func DatabaseIdx(databaseIdx int) ConfigOption

func PrimaryKey

func PrimaryKey(PrimaryKey string) ConfigOption

func SuffixScoreSetKey

func SuffixScoreSetKey(suffixScoreSetKey string) ConfigOption

type Pool

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

Pool contains dockertest and redis connection pool

func MustCreate

func MustCreate() *Pool

MustCreate creates new pool object

func (*Pool) Cleanup

func (p *Pool) Cleanup() error

Cleanup remove all data in redis

func (*Pool) Get

func (p *Pool) Get() redis.Conn

Get gets a connection with redis

func (*Pool) GetContext

func (p *Pool) GetContext(ctx context.Context) (redis.Conn, error)

GetContext gets a connection with redis

func (*Pool) MustClose

func (p *Pool) MustClose()

MustClose closes redis connection pool and dockertest pool

type RediStruct

type RediStruct interface {
	// Permission() Permission
	StoreType() StoreType
	PrimaryKey() string
	KeyDelimiter() string
	ScoreMap() map[string]interface{}
	Expire() time.Duration
	DatabaseIdx() int
	Serialized() []byte
	Deserialized([]byte)
}

RediStruct is an interface for hundling redistructs

type StoreType

type StoreType string

Jump to

Keyboard shortcuts

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