rc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MagicKey = "$"
View Source
const (
	RecordNotFoundPlaceholder float64 = -404.404 // 数据库为空的占位符
)

Variables

This section is empty.

Functions

func KeyGt

func KeyGt(key string) string

func KeyGte

func KeyGte(key string) string

func KeyLt

func KeyLt(key string) string

func KeyLte

func KeyLte(key string) string

func KeyWhere

func KeyWhere(key string) string

Types

type IRelationExpired

type IRelationExpired interface {
	RelationExpiredSecond() int
}

type Member

type Member struct {
	Data interface{}
}

func (*Member) Scan

func (myT *Member) Scan(value interface{}) error

type Option

type Option func(*relationOption)

func Order

func Order(field string) Option

func Size

func Size(limit int) Option

type RelationMapping

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

func NewRelationMapping

func NewRelationMapping(tx *gorm.DB, rc redis.UniversalClient) *RelationMapping

func (*RelationMapping) Exist

func (r *RelationMapping) Exist(
	unknownValue string,
	model interface{},
	unknownField string,
	knownMap map[string]interface{},
	options ...Option,
) (bool, error)

func (*RelationMapping) Key

func (r *RelationMapping) Key(
	model interface{},
	unknownField string,
	knownMap map[string]interface{},
	options ...Option,
) (string, error)

Key k = $(zset:relation:$tableName:zsize:$size:sortby:$order:$key1:$value1:$key2:$value2:unknownField:$unknownField).trim() k = $(z:r:$tableName:zs:$size:sb:$order:$key1:$value1:$key2:$value2:uf:$unknownField).trim() v =

func (*RelationMapping) List

func (r *RelationMapping) List(
	results interface{},
	start int64,
	stop int64,
	model interface{},
	unknownField string,
	knownMap map[string]interface{},
	options ...Option,
) error

func (*RelationMapping) ListByScore

func (r *RelationMapping) ListByScore(
	results interface{},
	by *redis.ZRangeBy,
	model interface{},
	unknownField string,
	knownMap map[string]interface{},
	options ...Option,
) error

func (*RelationMapping) ListByScoreWithZ

func (r *RelationMapping) ListByScoreWithZ(
	results interface{},
	by *redis.ZRangeBy,
	model interface{},
	unknownField string,
	knownMap map[string]interface{},
	options ...Option,
) ([]redis.Z, error)

返回 []redis.Z

type Score

type Score struct {
	Data interface{}
}

func (Score) Float64

func (myT Score) Float64() float64

func (*Score) Scan

func (myT *Score) Scan(value interface{}) error

Jump to

Keyboard shortcuts

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