database

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sqlx.DB
}

func New

func New(dsn string, automigrate bool) (*DB, error)

func (*DB) CreateTracker

func (db *DB) CreateTracker(guid string) error

func (*DB) DeleteTrackersOlderThan

func (db *DB) DeleteTrackersOlderThan(created_at string) error

func (*DB) GetTracker

func (db *DB) GetTracker(guid string) (Tracker, error)

func (*DB) GetTrackerByHash

func (db *DB) GetTrackerByHash(hash string) (Tracker, error)

func (*DB) UpdateTracker

func (db *DB) UpdateTracker(guid string, txResult string, ratio float64, seedTime int, hash string) error

type Tracker

type Tracker struct {
	Hash                 string  `db:"hash"`
	CreatedAt            string  `db:"created_at"`
	TransmissionTxResult string  `db:"transmission_tx_result"`
	TransmissionRatio    float64 `db:"transmission_ratio"`
	TransmissionSeedTime int     `db:"transmission_seed_time"`
	TransmissionStatus   *string `db:"transmission_status"`
	Guid                 string  `db:"guid"`
}

Jump to

Keyboard shortcuts

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