dao

package
v0.0.0-...-a69402d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 9 Imported by: 0

README

dao

数据访问层,负责访问 DB、MC、外部 HTTP 等接口,对上层屏蔽数据访问细节。

具体职责有:

  • SQL 拼接和 DB 访问逻辑
  • DB 的拆库折表逻辑
  • DB 的缓存读写逻辑
  • HTTP 接口调用逻辑

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncXORMTables

func SyncXORMTables()

Types

type LeafAllocDao

type LeafAllocDao struct {
	schema.LeafAlloc
}

func NewLeafAllocDao

func NewLeafAllocDao() *LeafAllocDao

func (*LeafAllocDao) GetAllLeafAllocs

func (dao *LeafAllocDao) GetAllLeafAllocs(ctx context.Context) (array []*LeafAllocDao, err error)

func (*LeafAllocDao) GetAllTags

func (dao *LeafAllocDao) GetAllTags(ctx context.Context) (array []string, err error)

func (*LeafAllocDao) GetLeafAlloc

func (dao *LeafAllocDao) GetLeafAlloc(ctx context.Context, tag string) (err error)

func (*LeafAllocDao) UpdateMaxId

func (dao *LeafAllocDao) UpdateMaxId(ctx context.Context, tag string) (err error)

func (*LeafAllocDao) UpdateMaxIdAndGetLeafAlloc

func (dao *LeafAllocDao) UpdateMaxIdAndGetLeafAlloc(ctx context.Context, tag string) (err error)

func (*LeafAllocDao) UpdateMaxIdByCustomStep

func (dao *LeafAllocDao) UpdateMaxIdByCustomStep(ctx context.Context, step int, tag string) (err error)

func (*LeafAllocDao) UpdateMaxIdByCustomStepAndGetLeafAlloc

func (dao *LeafAllocDao) UpdateMaxIdByCustomStepAndGetLeafAlloc(ctx context.Context, oldDao *LeafAllocDao) (err error)

type SegmentBufferDao

type SegmentBufferDao struct {
	models.SegmentBuffer
	Segments []*SegmentDao
}

func NewSegmentBufferDao

func NewSegmentBufferDao() *SegmentBufferDao

func (*SegmentBufferDao) GetCurrent

func (dao *SegmentBufferDao) GetCurrent() *SegmentDao

func (*SegmentBufferDao) GetCurrentPos

func (dao *SegmentBufferDao) GetCurrentPos() int

func (*SegmentBufferDao) GetKey

func (dao *SegmentBufferDao) GetKey() string

func (*SegmentBufferDao) GetMinStep

func (dao *SegmentBufferDao) GetMinStep() int

func (*SegmentBufferDao) GetSegments

func (dao *SegmentBufferDao) GetSegments() []*SegmentDao

func (*SegmentBufferDao) GetStep

func (dao *SegmentBufferDao) GetStep() int

func (*SegmentBufferDao) GetThreadRunning

func (dao *SegmentBufferDao) GetThreadRunning() *atomic.Bool

func (*SegmentBufferDao) GetUpdateTimeStamp

func (dao *SegmentBufferDao) GetUpdateTimeStamp() int64

func (*SegmentBufferDao) IsInitOk

func (dao *SegmentBufferDao) IsInitOk() bool

func (*SegmentBufferDao) IsNextReady

func (dao *SegmentBufferDao) IsNextReady() bool

func (*SegmentBufferDao) NextPos

func (dao *SegmentBufferDao) NextPos() int

func (*SegmentBufferDao) ReadLock

func (dao *SegmentBufferDao) ReadLock()

func (*SegmentBufferDao) ReadUnLock

func (dao *SegmentBufferDao) ReadUnLock()

func (*SegmentBufferDao) SetInitOk

func (dao *SegmentBufferDao) SetInitOk(initOk bool)

func (*SegmentBufferDao) SetKey

func (dao *SegmentBufferDao) SetKey(key string)

func (*SegmentBufferDao) SetMinStep

func (dao *SegmentBufferDao) SetMinStep(minStep int)

func (*SegmentBufferDao) SetNextReady

func (dao *SegmentBufferDao) SetNextReady(nextReady bool)

func (*SegmentBufferDao) SetStep

func (dao *SegmentBufferDao) SetStep(step int)

func (*SegmentBufferDao) SetUpdateTimeStamp

func (dao *SegmentBufferDao) SetUpdateTimeStamp(ts int64)

func (*SegmentBufferDao) SwitchPos

func (dao *SegmentBufferDao) SwitchPos()

func (*SegmentBufferDao) WriteLock

func (dao *SegmentBufferDao) WriteLock()

func (*SegmentBufferDao) WriteULock

func (dao *SegmentBufferDao) WriteULock()

type SegmentDao

type SegmentDao struct {
	models.Segment
	Buffer *SegmentBufferDao
}

func NewSegmentDao

func NewSegmentDao(dao *SegmentBufferDao) *SegmentDao

func (*SegmentDao) GetBuffer

func (dao *SegmentDao) GetBuffer() *SegmentBufferDao

func (*SegmentDao) GetIdle

func (dao *SegmentDao) GetIdle() int64

func (*SegmentDao) GetMax

func (dao *SegmentDao) GetMax() int64

func (*SegmentDao) GetStep

func (dao *SegmentDao) GetStep() int

func (*SegmentDao) GetValue

func (dao *SegmentDao) GetValue() *atomic.Int64

func (*SegmentDao) SetMax

func (dao *SegmentDao) SetMax(max int64)

func (*SegmentDao) SetStep

func (dao *SegmentDao) SetStep(step int)

func (*SegmentDao) SetValue

func (dao *SegmentDao) SetValue(value *atomic.Int64)

Jump to

Keyboard shortcuts

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