block

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusDB    = "seq"
	SyncSeq     = "sync_seq"
	DefaultType = "_doc"
)

sync status

View Source
const Mapping = `` /* 476-byte string literal not displayed */

Mapping block mapping

Variables

This section is empty.

Functions

This section is empty.

Types

type LastSyncSeq

type LastSyncSeq struct {
	SyncSeq int64 `json:"sync_seq"`
}

LastSyncSeq 同于记录同步的seq

type LastSyncSeqRecord

type LastSyncSeqRecord struct {
	*db.IKey
	*db.Op
	Seq *LastSyncSeq
}

LastSyncSeqRecord 用于db 记录 LastSyncSeq

func NewLastRecord

func NewLastRecord(seq int64) *LastSyncSeqRecord

NewLastRecord create LastSyncSeqRecord

func (*LastSyncSeqRecord) Value

func (r *LastSyncSeqRecord) Value() []byte

Value impl

type Seq

type Seq struct {
	// 同于记录同步的seq, 如果切换节点可以用上, 不切换节点一直和 Number 一致
	SyncSeq int `json:"sync_seq"`
	// 设置从何处同步的
	From   string `json:"from"`
	Number int    `json:"number"`
	// Seq 的具体信息
	Hash        string `json:"hash"`
	Type        int    `json:"type"`
	BlockDetail []byte `json:"block_detall"`
}

Seq 记录同步好的block 信息: id = sync_seq

type SeqRecord

type SeqRecord struct {
	*db.IKey
	*db.Op
	// contains filtered or unexported fields
}

SeqRecord 用于db 记录 BlockSeq

func NewSeqRecord

func NewSeqRecord(blockSeq *Seq) *SeqRecord

NewSeqRecord create SeqRecord

func (*SeqRecord) Value

func (r *SeqRecord) Value() []byte

Value impl

Jump to

Keyboard shortcuts

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