bitcoin

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBBTCAddressesSchema = `` /* 312-byte string literal not displayed */

	QueryUnusedAddress = `SELECT * FROM btc_addresses WHERE used = 0 LIMIT 1 `

	UpdateAddressQuery = `UPDATE btc_addresses 
		SET linked_article_id = ?,
		linked_article_title = ?,
		used = ?
		WHERE addr_id = ?
	`
)

Variables

View Source
var DB = db.DB

Functions

func GetAddressCtrl

func GetAddressCtrl(c *gin.Context)

Types

type BTCAddress

type BTCAddress struct {
	ID                 int64  `db:"addr_id"`
	Address            string `db:"address"`
	AddrPosition       int64  `db:"address_position"`
	LinkedArticleTitle string `db:"linked_article_title"`
	LinkedArticleID    string `db:"linked_article_id"`
	Used               bool   `db:"used"`
	Synced             bool   `db:"synced"`
}

func GetAddressByArticleID

func GetAddressByArticleID(artId string) (*BTCAddress, error)

func GetAddressByPos

func GetAddressByPos(pos int) (*BTCAddress, error)

func GetAddressForArticle

func GetAddressForArticle(artId string, artTitle string) (*BTCAddress, error)

func GetAllUsedUnsyncedAddresses

func GetAllUsedUnsyncedAddresses() ([]*BTCAddress, error)

func GetNextUnused

func GetNextUnused() (*BTCAddress, error)

func (*BTCAddress) SetSynced

func (a *BTCAddress) SetSynced() error

TODO: Set address to synced

Jump to

Keyboard shortcuts

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