bizrecord

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemRecord

type ItemRecord struct {
	Count         uint32
	ID            uint64
	Date          string
	OperationType string
	ServerTag     string
	SaverType     SaverType
}

ItemRecord 道具记录

func (*ItemRecord) GetSaverType

func (r *ItemRecord) GetSaverType() SaverType

func (*ItemRecord) Load

func (r *ItemRecord) Load()

Load 加载

func (*ItemRecord) Save

func (r *ItemRecord) Save(Saver SaverIF) bool

Save 存储

type MongoConfig

type MongoConfig struct {
	DNS string
}

MongoConfig ...

func DefaultMongoConfig

func DefaultMongoConfig() MongoConfig

DefaultMongoConfig ...

type MongoSaver

type MongoSaver struct {
	*mongo.Client
}

MongoSaver ...

func NewMongoSaver

func NewMongoSaver(conf MongoConfig) MongoSaver

NewMongoSaver ...

func (*MongoSaver) Load

func (s *MongoSaver) Load(f func(saverIF SaverIF) RecordIF) RecordIF

func (MongoSaver) Save

func (s MongoSaver) Save(recordIF RecordIF) bool

type MysqlSaver

type MysqlSaver struct {
}

MysqlSaver ...

func (*MysqlSaver) Load

func (s *MysqlSaver) Load(f func(saverIF SaverIF) RecordIF) RecordIF

func (MysqlSaver) Save

func (s MysqlSaver) Save(recordIF RecordIF) bool

type RechargeRecord

type RechargeRecord struct {
	UserID    uint64
	Category  int
	Quantity  uint64
	Date      string
	SaverType SaverType
}

RechargeRecord ...

func (RechargeRecord) GetSaverType

func (r RechargeRecord) GetSaverType() SaverType

func (RechargeRecord) Load

func (r RechargeRecord) Load()

func (RechargeRecord) Save

func (r RechargeRecord) Save(saverIF SaverIF) bool

type RecordIF

type RecordIF interface {
	Save(saverIF SaverIF) bool
	Load()
	GetSaverType() SaverType
}

type RecordMgr

type RecordMgr struct {
	ChRecord chan RecordIF

	ChStop chan struct{}
	// contains filtered or unexported fields
}

func (*RecordMgr) AddSaver

func (m *RecordMgr) AddSaver(t SaverType, saver SaverIF) bool

AddSaver add saver

func (*RecordMgr) AsyncSave

func (m *RecordMgr) AsyncSave(record RecordIF)

AsyncSave ...

func (*RecordMgr) DelSaver

func (m *RecordMgr) DelSaver(t SaverType)

DelSaver ...

func (*RecordMgr) Run

func (m *RecordMgr) Run()

func (*RecordMgr) Save

func (m *RecordMgr) Save(record RecordIF) bool

Save ...

func (*RecordMgr) Stop

func (m *RecordMgr) Stop()

Stop ...

type SaverIF

type SaverIF interface {
	Save(recordIF RecordIF) bool
	Load(f func(saverIF SaverIF) RecordIF) RecordIF
}

type SaverType

type SaverType uint
const (
	SaverType_Mongo SaverType = iota + 1
	SaverType_Mysql
)

Jump to

Keyboard shortcuts

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