db_test

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinType

type CoinType string
const (
	CoinTypeXMR CoinType = "XMR"
	CoinTypeBTC CoinType = "BTC"
	CoinTypeLTC CoinType = "LTC"
	CoinTypeETH CoinType = "ETH"
	CoinTypeTON CoinType = "TON"
)

func (*CoinType) Scan

func (e *CoinType) Scan(src interface{}) error

type CryptoAddress

type CryptoAddress struct {
	ID         pgtype.UUID
	Address    string
	Coin       CoinType
	IsOccupied bool
	UserID     pgtype.UUID
}

type CryptoCache

type CryptoCache struct {
	Coin                  CoinType
	LastSyncedBlockHeight pgtype.Int8
	SyncedTimestamp       pgtype.Timestamptz
}

type CryptoDatum

type CryptoDatum struct {
	UserID pgtype.UUID
	XmrID  pgtype.UUID
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type FindJoinedCryptoDataByUserIdRow

type FindJoinedCryptoDataByUserIdRow struct {
	UserID         pgtype.UUID
	XmrID          pgtype.UUID
	ID             pgtype.UUID
	PrivViewKey    string
	PubSpendKey    string
	LastMajorIndex int32
	LastMinorIndex int32
}

type Invoice

type Invoice struct {
	ID                    pgtype.UUID
	CryptoAddress         string
	Coin                  CoinType
	RequiredAmount        float64
	ActualAmount          pgtype.Float8
	ConfirmationsRequired int16
	CreatedAt             pgtype.Timestamptz
	ConfirmedAt           pgtype.Timestamptz
	Status                InvoiceStatusType
	ExpiresAt             pgtype.Timestamptz
	TxID                  pgtype.Text
	UserID                pgtype.UUID
}

type InvoiceStatusType

type InvoiceStatusType string
const (
	InvoiceStatusTypePENDING        InvoiceStatusType = "PENDING"
	InvoiceStatusTypePENDINGMEMPOOL InvoiceStatusType = "PENDING_MEMPOOL"
	InvoiceStatusTypeEXPIRED        InvoiceStatusType = "EXPIRED"
	InvoiceStatusTypeCONFIRMED      InvoiceStatusType = "CONFIRMED"
)

func (*InvoiceStatusType) Scan

func (e *InvoiceStatusType) Scan(src interface{}) error

type NullCoinType

type NullCoinType struct {
	CoinType CoinType
	Valid    bool // Valid is true if CoinType is not NULL
}

func (*NullCoinType) Scan

func (ns *NullCoinType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullCoinType) Value

func (ns NullCoinType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullInvoiceStatusType

type NullInvoiceStatusType struct {
	InvoiceStatusType InvoiceStatusType
	Valid             bool // Valid is true if InvoiceStatusType is not NULL
}

func (*NullInvoiceStatusType) Scan

func (ns *NullInvoiceStatusType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInvoiceStatusType) Value

func (ns NullInvoiceStatusType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) FindAllInvoices

func (q *Queries) FindAllInvoices(ctx context.Context) ([]Invoice, error)

func (*Queries) FindAllInvoicesByIds

func (q *Queries) FindAllInvoicesByIds(ctx context.Context, dollar_1 []pgtype.UUID) ([]Invoice, error)

func (*Queries) FindCryptoAddressByAddress

func (q *Queries) FindCryptoAddressByAddress(ctx context.Context, address string) (CryptoAddress, error)

func (*Queries) FindInvoiceById

func (q *Queries) FindInvoiceById(ctx context.Context, id pgtype.UUID) (Invoice, error)

func (*Queries) FindJoinedCryptoDataByUserId

func (q *Queries) FindJoinedCryptoDataByUserId(ctx context.Context, userID pgtype.UUID) (FindJoinedCryptoDataByUserIdRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type User

type User struct {
	ID pgtype.UUID
}

type XmrCryptoDatum

type XmrCryptoDatum struct {
	ID             pgtype.UUID
	PrivViewKey    string
	PubSpendKey    string
	LastMajorIndex int32
	LastMinorIndex int32
}

Jump to

Keyboard shortcuts

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