offchain

package
v0.61.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsurePointers

func EnsurePointers(
	ctx context.Context,
	db *gorm.DB,
	now time.Time,
) (int, error)

EnsurePointers adds pending off-chain metadata cache rows for every currently known on-chain URL/hash pointer.

func FetchBatch

func FetchBatch(
	ctx context.Context,
	db *gorm.DB,
	limit int,
	now time.Time,
) ([]models.OffchainMetadata, error)

FetchBatch claims and returns pending or failed cache rows that are due for another fetch attempt.

func Get

func Get(
	db *gorm.DB,
	sourceType string,
	url string,
	hash []byte,
) (*models.OffchainMetadata, error)

Get retrieves one cached off-chain metadata document by source and on-chain URL/hash pointer. It returns nil when no cache row exists yet.

func SetFetchResult

func SetFetchResult(
	ctx context.Context,
	db *gorm.DB,
	doc *models.OffchainMetadata,
) error

SetFetchResult persists the worker's latest fetch status for an existing off-chain metadata cache row.

Types

This section is empty.

Jump to

Keyboard shortcuts

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