Documentation ¶
Index ¶
- Constants
- type Document
- type Documents
- type GetServerFunc
- type MsgHeader
- type OPAbortOperation
- type OPAggregateOperation
- type OPCode
- type OPCommitOperation
- type OPCountOperation
- type OPDeleteOperation
- type OPFindAndModifyOperation
- type OPFindOperation
- type OPInsertOperation
- type OPReply
- type OPStartTransactionOperation
- type OPUpdateOperation
- type Page
- type ReplyHeader
- type Transaction
- type TxStatus
Constants ¶
const ( CommandRDBOperation = "RDB" CommandWatchTransactionOperation = "WatchTransaction" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetServerFunc ¶
type OPAbortOperation ¶
type OPAbortOperation struct {
MsgHeader
}
OPAbortOperation abort operation request structure
type OPAggregateOperation ¶
type OPAggregateOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" Pipiline Documents // 要插入集合的文档 }
OPPipelineOperation insert operation request structure
type OPCode ¶
type OPCode uint32
OPCode operation code type
const ( // OPInsertCode insert operation code OPInsertCode OPCode = iota + 1 // OPUpdateCode update operation code OPUpdateCode // OPDeleteCode delete operation code OPDeleteCode // OPFindCode query operation code OPFindCode // OPFindAndModifyCode find and modify operation code OPFindAndModifyCode // OPCountCode count operation code OPCountCode // OPAggregateCode aggregate operation code OPAggregateCode // OPStartTransactionCode start a transaction code OPStartTransactionCode OPCode = 666 // OPCommitCode transaction commit operation code OPCommitCode OPCode = 667 // OPAbortCode transaction abort operation code OPAbortCode OPCode = 668 )
type OPCommitOperation ¶
type OPCommitOperation struct {
MsgHeader
}
OPCommitOperation commit operation request structure
type OPCountOperation ¶
type OPCountOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" Selector Document // 文档查询条件 }
OPCountOperation count operation request structure
type OPDeleteOperation ¶
type OPDeleteOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" Selector Document // 文档查询条件 }
OPDeleteOperation delete operation request structure
type OPFindAndModifyOperation ¶
type OPFindAndModifyOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" DOC Document // 指定要执行的更新 Selector Document // 文档查询条件 Upsert bool Remove bool ReturnNew bool }
OPFindAndModifyOperation find and modify operation request structure
type OPFindOperation ¶
type OPFindOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" Projection Document // "" Selector Document // 文档查询条件 Start uint64 // start index Limit uint64 // limit index Sort string // sort string }
OPFindOperation find operation request structure
type OPInsertOperation ¶
type OPInsertOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" DOCS Documents // 要插入集合的文档 }
OPInsertOperation insert operation request structure
type OPReply ¶
type OPReply struct { ReplyHeader // 标准报文头 Count uint64 // 文档查询结果数 Docs Documents // 文档查询结果 }
OPReply the operation reply message header structure
type OPStartTransactionOperation ¶
type OPStartTransactionOperation struct {
MsgHeader
}
OPStartTransactionOperation transaction request structure
type OPUpdateOperation ¶
type OPUpdateOperation struct { MsgHeader // 标准报文头 Collection string // "dbname.collectionname" DOC Document // 指定要执行的更新 Selector Document // 文档查询条件 }
OPUpdateOperation update operation request structure
type Page ¶
type ReplyHeader ¶
ReplyHeader the rpc message header structure
type Transaction ¶
type Transaction 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"` // 修改时间,作为统计信息存在 }
func (Transaction) IntoHeader ¶
func (t Transaction) IntoHeader(header http.Header) http.Header