repo

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate added in v0.1.3

func AutoMigrate()

func CreatePurchase added in v0.4.1

func CreatePurchase(purchase *models.Purchase) error

CreatePurchase creates a new order purchase and will cancel previous unprocessed purchases

func GetAllPackages added in v0.3.1

func GetAllPackages() ([]*models.Package, error)

func GetAllUsers added in v0.2.1

func GetAllUsers() ([]*models.Tuser, error)

func GetKeyVal added in v0.3.1

func GetKeyVal(key string) ([]*models.Keyval, error)

func GetPackage

func GetPackage(name string) (*models.Package, error)

func GetPurchaseById added in v0.3.1

func GetPurchaseById(id int64) (*models.Purchase, error)

func GetUser

func GetUser(userId int64) (*models.Tuser, error)

func GetUserByTid added in v0.3.1

func GetUserByTid(uid uint64) (*models.Tuser, error)

func GetUserByToken added in v0.2.1

func GetUserByToken(token string) (*models.Tuser, error)

func GetXNodes

func GetXNodes() ([]*models.Xnode, error)

func InsertPurchase added in v0.3.1

func InsertPurchase(purchase *models.Purchase) error

func LastPurchasesByUserId added in v0.3.1

func LastPurchasesByUserId(uid int64, status PurchaseStatus) (*models.Purchase, error)

func SaveOrUpdateUser

func SaveOrUpdateUser(u *models.Tuser) error

func SaveOrUpdateXNode

func SaveOrUpdateXNode(node *models.Xnode) error

func SetKeyVal added in v0.3.1

func SetKeyVal(key, value string) error

func SetPurchaseAsProcessing added in v0.3.1

func SetPurchaseAsProcessing(purchase *models.Purchase) error

func SetupDb

func SetupDb(dsn string)

func SetupPackage

func SetupPackage()

func UpdatePurchase added in v0.3.1

func UpdatePurchase(p *models.Purchase) error

func UpdateUser

func UpdateUser(u *models.Tuser) error

Types

type PurchaseStatus added in v0.3.1

type PurchaseStatus int64
const (
	PurchaseUnknown PurchaseStatus = iota
	PurchaseConfirmed
	PurchaseIsProcessing
	PurchaseRejected
	PurchaseCancelled
	PurchaseWaitingForBankCallback
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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