loopbacksync

package
v0.0.0-...-6fba4f8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//MarkTableName mark table name
	MarkTableName = "retl._drainer_repl_mark"
	//ID syncer worker coroutine id
	ID = "id"
	//ChannelID channel id
	ChannelID = "channel_id"
	//Val val
	Val = "val"
	//ChannelInfo channel info
	ChannelInfo = "channel_info"
)

Variables

View Source
var CreateMarkDBDDL = "create database IF NOT EXISTS retl;"

CreateMarkDBDDL is DDL to create the database of mark table.

View Source
var CreateMarkTableDDL string = fmt.Sprintf("CREATE TABLE If Not Exists %s (%s bigint not null,%s bigint not null DEFAULT 0, %s bigint DEFAULT 0, %s varchar(64) ,PRIMARY KEY (%s,%s));", MarkTableName, ID, ChannelID, Val, ChannelInfo, ID, ChannelID)

CreateMarkTableDDL is the DDL to create the mark table.

Functions

func CleanMarkTableData

func CleanMarkTableData(db *sql.DB, channelID int64) error

CleanMarkTableData clean up the data in mark table.

func CreateMarkTable

func CreateMarkTable(db *sql.DB) error

CreateMarkTable create the db and table if need.

func InitMarkTableData

func InitMarkTableData(db *sql.DB, rowNum int, channelID int64) error

InitMarkTableData init rowNum rows in the mark table for channelID.

func UpdateMark

func UpdateMark(tx *sql.Tx, id int64, channelID int64) error

UpdateMark update the mark table.

Types

type LoopBackSync

type LoopBackSync struct {
	ChannelID       int64
	LoopbackControl bool
	SyncDDL         bool
}

LoopBackSync loopback sync info

func NewLoopBackSyncInfo

func NewLoopBackSyncInfo(ChannelID int64, LoopbackControl, SyncDDL bool) *LoopBackSync

NewLoopBackSyncInfo return LoopBackSyncInfo objec

Jump to

Keyboard shortcuts

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