db

package
v0.0.0-...-c113072 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEART_BEAT_INTERVAL = 10
	CONNECT_TIMEOUT     = 3
	MAX_CONNIDLE_TIME   = 60
)

Variables

This section is empty.

Functions

func AppendRecordForRecordCache

func AppendRecordForRecordCache(ctx context.Context, roomId string, record *model.Record) error

func Close

func Close(ctx context.Context)

func CreateRecordCache

func CreateRecordCache(ctx context.Context, cache *model.RecordCache) error

func FindRoom

func FindRoom(ctx context.Context, roomId string) bool

func GetCache

func GetCache(ctx context.Context, roomId string) (cache *model.RecordCache, err error)

func InitDb

func InitDb(addr []string, maxpollsize uint64, username, password, source string) error

func SetEnd

func SetEnd(ctx context.Context, roomId, display string, startTime uint64) error

func SetUrl

func SetUrl(ctx context.Context, roomId, display string, startTime uint64, url string) error

Types

type DbManager

type DbManager struct {
	Mongo  *mongo.Client
	DbName string
}

func (*DbManager) CloseDb

func (dbm *DbManager) CloseDb(ctx context.Context)

func (*DbManager) InitDb

func (dbm *DbManager) InitDb(addr []string, maxpollsize uint64, username, password, source string) error

Jump to

Keyboard shortcuts

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