table

package
v0.0.0-...-e5aaa3f Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Username string
	Nickname string
	Email    string
	QQ       string
	Telegram string
	Money    int
	Password string

	database.Table
	// contains filtered or unexported fields
}

func DeleteAccount

func DeleteAccount(db *pg.DB, username string) (*Account, error)

func InsertAccount

func InsertAccount(db *pg.DB, username, email, qq string) (*Account, error)

func QueryAccountByEmail

func QueryAccountByEmail(db *pg.DB, email string) (*Account, error)

func QueryAccountByQQ

func QueryAccountByQQ(db *pg.DB, qq string) (*Account, error)

func QueryAccountByTelegram

func QueryAccountByTelegram(db *pg.DB, telegram string) (*Account, error)

func QueryAccountByUsername

func QueryAccountByUsername(db *pg.DB, username string) (*Account, error)

func QueryAccountByUsernames

func QueryAccountByUsernames(db *pg.DB, usernames []string) ([]Account, error)

func UpdateAccountTelegramByUsername

func UpdateAccountTelegramByUsername(db *pg.DB, username, telegram string) (*Account, error)

type Package

type Package struct {
	ID          string
	Name        string
	Description string
	Nodes       []string `pg:",array"`
	Money       int
	Day         int
	Traffic     int
	Device      int

	database.Table
	// contains filtered or unexported fields
}

func QueryPackageByName

func QueryPackageByName(db *pg.DB, name string) (*Package, error)

type Subscription

type Subscription struct {
	Package  string
	Account  string
	Key      string
	UUID     string
	Status   string
	ExpireAt time.Time

	database.Table
	// contains filtered or unexported fields
}

func DeleteSubscription

func DeleteSubscription(db *pg.DB, key string) (*Subscription, error)

func InsertSubscription

func InsertSubscription(db *pg.DB, account, _package string, day time.Duration) (*Subscription, error)

func QuerySubscriptionByKey

func QuerySubscriptionByKey(db *pg.DB, key string) (*Subscription, error)

func QuerySubscriptionExpired

func QuerySubscriptionExpired(db *pg.DB) ([]Subscription, error)

func QuerySubscriptionsByUsername

func QuerySubscriptionsByUsername(db *pg.DB, username string) ([]Subscription, error)

func UpdateSubscriptionExpired

func UpdateSubscriptionExpired(db *pg.DB, key string, expired time.Time) (*Subscription, error)

func UpdateSubscriptionPackage

func UpdateSubscriptionPackage(db *pg.DB, key, _package string) (*Subscription, error)

func UpdateSubscriptionStatus

func UpdateSubscriptionStatus(db *pg.DB, key, status string) (*Subscription, error)

Jump to

Keyboard shortcuts

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