types

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandRDBOperation              = "RDB"
	CommandMigrateOperation          = "DBMigrate"
	CommandWatchTransactionOperation = "WatchTransaction"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document map[string]interface{}

func (Document) Decode

func (d Document) Decode(result interface{}) error

func (*Document) Encode

func (d *Document) Encode(value interface{}) error

type Documents

type Documents []Document

func (Documents) Decode

func (d Documents) Decode(result interface{}) error

func (*Documents) Encode

func (d *Documents) Encode(value interface{}) error

type Page

type Page struct {
	Limit uint64 `json:"limit,omitempty" bson:"limit,omitempty"`
	Start uint64 `json:"start,omitempty" bson:"start,omitempty"`
	Sort  string `json:"sort,omitempty" bson:"sort,omitempty"`
}

func ParsePage

func ParsePage(origin interface{}) *Page

type TransactionInfo

type TransactionInfo struct {
	TxnID        string    `bson:"bk_txn_id"`     // 事务ID,uuid
	RequestID    string    `bson:"bk_request_id"` // 请求ID,可选项
	Processor    string    `bson:"processor"`     // 处理进程号,结构为"IP:PORT-PID"用于识别事务session被存于那个TM多活实例
	Status       TxStatus  `bson:"status"`        // 事务状态,作为定时补偿判断条件,这个字段需要加索引
	CreateTime   time.Time `bson:"create_time"`   // 创建时间,作为定时补偿判断条件和统计信息存在,这个字段需要加索引
	LastTime     time.Time `bson:"last_time"`     // 修改时间,作为统计信息存在
	TMAddr       string    // TMServer IP. 存放事务对应的db session 存在TMServer地址的IP
	SessionID    string    // 会话ID
	SessionState string    // 会话State
	TxnNumber    string    // 事务Number
}

type TxStatus

type TxStatus int
const (
	TxStatusOnProgress TxStatus = iota + 1
	TxStatusCommitted
	TxStatusAborted
	TxStatusException
)

TxStatus enumerations

func (TxStatus) String

func (s TxStatus) String() string

Jump to

Keyboard shortcuts

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