timestamps

package
v0.0.0-...-5a53b6d Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, db *sql.DB, timestamp FileTimestamp) (int64, error)

func Update

func Update(ctx context.Context, db *sql.DB, id int64, txid *string, blockHeight *int64, status Status, confirmedAt *time.Time) error

func UpdateFilename

func UpdateFilename(ctx context.Context, db *sql.DB, id int64, filename string) error

func WithStatus

func WithStatus(status Status) func(*ListOpts)

Types

type FileTimestamp

type FileTimestamp struct {
	ID          int64
	Filename    string
	FileHash    string
	TxID        *string
	BlockHeight *int64
	Status      Status
	CreatedAt   time.Time
	ConfirmedAt *time.Time
}

func Get

func Get(ctx context.Context, db *sql.DB, id int64) (*FileTimestamp, error)

func GetByHash

func GetByHash(ctx context.Context, db *sql.DB, fileHash string) (*FileTimestamp, error)

func List

func List(ctx context.Context, db *sql.DB, opts ...func(*ListOpts)) ([]FileTimestamp, error)

type ListOpts

type ListOpts struct {
	Status *Status
}

type Status

type Status string
const (
	StatusPending    Status = "pending"
	StatusConfirming Status = "confirming"
	StatusConfirmed  Status = "confirmed"
	StatusFailed     Status = "failed"
)

Jump to

Keyboard shortcuts

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