tracker

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoReturnLimit = 0
	WipStr        = "_wip"
)

Variables

This section is empty.

Functions

func BuildSliceFromSections added in v1.2.2

func BuildSliceFromSections(sections Sections) *[]uint64

func ClearInProgress

func ClearInProgress(id string, db *gorm.DB) error

func FindGapsInSections added in v1.2.2

func FindGapsInSections(sections Sections) *[]uint64

func GetMissingHeights

func GetMissingHeights(chainTip uint64, genesisHeight uint64, limit uint64, id string, db *gorm.DB) (*[]uint64, error)

func GetTrackedHeights

func GetTrackedHeights(id string, db *gorm.DB) (*[]uint64, error)

func GetTrackedTip

func GetTrackedTip(db *gorm.DB, refTrackId string) (uint64, error)

func RemoveHeights

func RemoveHeights(heights *[]uint64, id string, db *gorm.DB) error

func RemoveSectionsFromTracker

func RemoveSectionsFromTracker(toRemove Sections, id string, db *gorm.DB) error

func UpdateAndRemoveWipHeights

func UpdateAndRemoveWipHeights(heights *[]uint64, id string, dbConn *gorm.DB) error

func UpdateInProgressHeight

func UpdateInProgressHeight(track bool, heights *[]uint64, id string, db *gorm.DB) error

func UpdateTrackedHeights

func UpdateTrackedHeights(heights *[]uint64, id string, db *gorm.DB) error

Types

type DbSection

type DbSection struct {
	Section
	IndexerId string
}

type DbSections

type DbSections = []DbSection

type Section

type Section struct {
	StartIdx uint64
	EndIdx   uint64
}

Section defines an interval of heights with inclusive boundaries [StartIdx, EndIdx]

func (Section) TableName

func (Section) TableName() string

type SectionId

type SectionId struct {
	Sections
	IndexerId string
}

type Sections

type Sections = []Section

func BuildSectionsFromSlice added in v1.2.2

func BuildSectionsFromSlice(heights *[]uint64) Sections

func MergeSections added in v1.2.2

func MergeSections(sections Sections) Sections

func RemoveSections

func RemoveSections(sections, toRemove Sections) Sections

RemoveSections removes any sections included in (toRemove: Sections) that intersect with (sections: Sections)

Jump to

Keyboard shortcuts

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