dc

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StringDetailPrefix        = "string:detail"
	RecordNotFoundPlaceholder = "@-1" // 数据库为空的占位符
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DbMapping

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

DbMapping 数据库模型的映射

func GetDbMapping

func GetDbMapping(rc redis.UniversalClient, tx *gorm.DB) *DbMapping

func (*DbMapping) FirstById

func (v *DbMapping) FirstById(model interface{}, id string, options ...FuncFirstOption) error

func (*DbMapping) FirstByWhere

func (v *DbMapping) FirstByWhere(model interface{}, whereMap map[string][]interface{}, options ...FuncFirstOption) error

func (*DbMapping) FlushByIds

func (v *DbMapping) FlushByIds(model interface{}, ids []string, options ...FuncFirstOption) error

func (*DbMapping) FlushByWhere

func (v *DbMapping) FlushByWhere(model interface{}, whereMap map[string][]interface{}, options ...FuncFirstOption) error

func (*DbMapping) Key

func (v *DbMapping) Key(model interface{}, whereMap map[string][]interface{}, options ...FuncFirstOption) string

func (*DbMapping) KeyById

func (v *DbMapping) KeyById(model interface{}, id string, options ...FuncFirstOption) string

func (*DbMapping) ListByIds

func (v *DbMapping) ListByIds(model interface{}, results interface{}, ids []string, options ...FuncFirstOption) error

ListByIds

func (*DbMapping) MapByID

func (v *DbMapping) MapByID(
	model,
	list interface{},
	mp interface{},
	ids []string,
	options ...FuncFirstOption,
) error

type FirstOption

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

type FuncFirstOption

type FuncFirstOption func(*FirstOption)

func WithOrder

func WithOrder(
	order string,
) FuncFirstOption

type IDetailExpired

type IDetailExpired interface {
	DetailExpiredSecond() int
}

Jump to

Keyboard shortcuts

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