database

package module
v0.0.0-...-23f842b Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

README

Database API for donate

See GoDoc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(db *sql.DB, issue Issue) (err error)

Add issue to the database.

func GetWallets

func GetWallets(db *sql.DB, issue *Issue, sp SeedPrivacy) (err error)

GetWallets for the issue. Repo and ID of the issue should be filled.

func IsExists

func IsExists(db *sql.DB, issue Issue) (exists bool, err error)

IsExists check for the issue. Repo and ID of the issue should be filled.

func Open

func Open(path string) (db *sql.DB, err error)

Open (or create new) sqlite3 database on the path, and generate all tables if they do not exist.

Types

type Issue

type Issue struct {
	// Repo in format "github.com/jollheef/donate"
	Repo string
	// ID of the issue on GitHub (not internal database one!)
	ID int
	// Cryptocurrency wallets
	Wallets map[c.Cryptocurrency]Wallet
}

Issue with corresponding wallets for donations

func AllIssues

func AllIssues(db *sql.DB, repo string, sp SeedPrivacy) (issues []Issue, err error)

AllIssues from database for repository

func NewIssue

func NewIssue() (issue Issue)

NewIssue returns issue with allocated wallets

type SeedPrivacy

type SeedPrivacy int

SeedPrivacy declare should be seed shown in wallet structure or not

const (
	// HideSeed in wallet structure
	HideSeed SeedPrivacy = iota
	// Show in Wallet structure
	ShowSeed
)

type Wallet

type Wallet struct {
	// Seed for wallet restoration
	Seed string `json:"-"`
	// Address for dotations
	Address string
}

Wallet for cryptocurrency

Jump to

Keyboard shortcuts

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