db

package
v0.0.0-...-f32326c Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBatchAlreadyClosed = errors.New("batch already closed")
)

Functions

This section is empty.

Types

type AddWalletAssetQuantityParams

type AddWalletAssetQuantityParams struct {
	Quantity int64 `json:"quantity"`
	WalletID int64 `json:"wallet_id"`
	AssetID  int64 `json:"asset_id"`
}

type AddWarehouseAssetQuantityParams

type AddWarehouseAssetQuantityParams struct {
	Quantity    int64 `json:"quantity"`
	WarehouseID int64 `json:"warehouse_id"`
	AssetID     int64 `json:"asset_id"`
}

type AddWarehouseCollateralParams

type AddWarehouseCollateralParams struct {
	Collateral int64 `json:"collateral"`
	ID         int64 `json:"id"`
}

type AddWarehouseLiabilityParams

type AddWarehouseLiabilityParams struct {
	Liability int64 `json:"liability"`
	ID        int64 `json:"id"`
}

type Asset

type Asset struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Value int64  `json:"value"`
}

type CountAssignedWalletParams

type CountAssignedWalletParams struct {
	UserID   int64 `json:"user_id"`
	WalletID int64 `json:"wallet_id"`
}

type CountWalletsByIdAndUserIdParams

type CountWalletsByIdAndUserIdParams struct {
	ID     int64 `json:"id"`
	UserID int64 `json:"user_id"`
}

type CreateAssetParams

type CreateAssetParams struct {
	Name  string `json:"name"`
	Value int64  `json:"value"`
}

type CreateTransactionAssetParams

type CreateTransactionAssetParams struct {
	TransactionID int64 `json:"transaction_id"`
	AssetID       int64 `json:"asset_id"`
	Quantity      int64 `json:"quantity"`
}

type CreateTransactionAssetsBatchResults

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

func (*CreateTransactionAssetsBatchResults) Close

func (*CreateTransactionAssetsBatchResults) Exec

func (b *CreateTransactionAssetsBatchResults) Exec(f func(int, error))

type CreateTransactionAssetsParams

type CreateTransactionAssetsParams struct {
	TransactionID int64 `json:"transaction_id"`
	AssetID       int64 `json:"asset_id"`
	Quantity      int64 `json:"quantity"`
}

type CreateTransactionParams

type CreateTransactionParams struct {
	SendingWalletID   int64       `json:"sending_wallet_id"`
	ReceivingWalletID int64       `json:"receiving_wallet_id"`
	CreatedAt         time.Time   `json:"created_at"`
	Memo              pgtype.Text `json:"memo"`
}

type CreateTransferAssetsBatchResults

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

func (*CreateTransferAssetsBatchResults) Close

func (*CreateTransferAssetsBatchResults) Exec

func (b *CreateTransferAssetsBatchResults) Exec(f func(int, error))

type CreateTransferAssetsParams

type CreateTransferAssetsParams struct {
	TransferID int64 `json:"transfer_id"`
	AssetID    int64 `json:"asset_id"`
	Quantity   int64 `json:"quantity"`
}

type CreateWalletAssetParams

type CreateWalletAssetParams struct {
	WalletID int64 `json:"wallet_id"`
	AssetID  int64 `json:"asset_id"`
	Quantity int64 `json:"quantity"`
}

type CreateWalletParams

type CreateWalletParams struct {
	Address string `json:"address"`
	UserID  int64  `json:"user_id"`
}

type CreateWalletSessionParams

type CreateWalletSessionParams struct {
	Key      string      `json:"key"`
	WalletID int64       `json:"wallet_id"`
	Name     pgtype.Text `json:"name"`
}

type CreateWalletUserParams

type CreateWalletUserParams struct {
	WalletID int64 `json:"wallet_id"`
	UserID   int64 `json:"user_id"`
}

type CreateWarehouseAssetParams

type CreateWarehouseAssetParams struct {
	WarehouseID int64 `json:"warehouse_id"`
	AssetID     int64 `json:"asset_id"`
	Quantity    int64 `json:"quantity"`
}

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
	SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
}

type DeleteUserSessionByUserIdAndWalletIdParams

type DeleteUserSessionByUserIdAndWalletIdParams struct {
	UserID   int64 `json:"user_id"`
	WalletID int64 `json:"wallet_id"`
}

type DeleteWalletAssetParams

type DeleteWalletAssetParams struct {
	WalletID int64 `json:"wallet_id"`
	AssetID  int64 `json:"asset_id"`
}

type DeleteWalletUserParams

type DeleteWalletUserParams struct {
	WalletID int64 `json:"wallet_id"`
	UserID   int64 `json:"user_id"`
}

type DeleteWarehouseWorkerParams

type DeleteWarehouseWorkerParams struct {
	ID     int64 `json:"id"`
	UserID int64 `json:"user_id"`
}

type ExistsWarehouseWorkerByUsernameParams

type ExistsWarehouseWorkerByUsernameParams struct {
	WarehouseID int64  `json:"warehouse_id"`
	Username    string `json:"username"`
}

type ExistsWarehouseWorkerParams

type ExistsWarehouseWorkerParams struct {
	WarehouseID int64 `json:"warehouse_id"`
	UserID      int64 `json:"user_id"`
}

type GetAssetsIdNameByNamesRow

type GetAssetsIdNameByNamesRow struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type GetAssignedUsersByWalletIdRow

type GetAssignedUsersByWalletIdRow struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
}

type GetAssignedWalletsByUserIdRow

type GetAssignedWalletsByUserIdRow struct {
	ID      int64  `json:"id"`
	Address string `json:"address"`
	UserID  int64  `json:"user_id"`
}

type GetTransactionsDetailedParams

type GetTransactionsDetailedParams struct {
	SendingWalletID int64 `json:"sending_wallet_id"`
	Limit           int32 `json:"limit"`
	Offset          int32 `json:"offset"`
}

type GetTransactionsDetailedRow

type GetTransactionsDetailedRow struct {
	ID                int64       `json:"id"`
	SendingWalletID   int64       `json:"sending_wallet_id"`
	ReceivingWalletID int64       `json:"receiving_wallet_id"`
	SendingAddress    string      `json:"sending_address"`
	ReceivingAddress  string      `json:"receiving_address"`
	SendingUsername   pgtype.Text `json:"sending_username"`
	ReceivingUsername pgtype.Text `json:"receiving_username"`
	Memo              pgtype.Text `json:"memo"`
	CreatedAt         time.Time   `json:"created_at"`
}

type GetTransactionsParams

type GetTransactionsParams struct {
	SendingWalletID int64 `json:"sending_wallet_id"`
	Limit           int32 `json:"limit"`
	Offset          int32 `json:"offset"`
}

type GetTransferAssetsByTransferIdRow

type GetTransferAssetsByTransferIdRow struct {
	AssetID  int64  `json:"asset_id"`
	Name     string `json:"name"`
	Quantity int64  `json:"quantity"`
}

type GetTransferAssetsParams

type GetTransferAssetsParams struct {
	ID                 int64 `json:"id"`
	SendingWarehouseID int64 `json:"sending_warehouse_id"`
}

type GetTransferAssetsRow

type GetTransferAssetsRow struct {
	AssetID   int64  `json:"asset_id"`
	AssetName string `json:"asset_name"`
	Quantity  int64  `json:"quantity"`
}

type GetTransferInboundRequestsRow

type GetTransferInboundRequestsRow struct {
	ID                     int64          `json:"id"`
	ReceivingWarehouseName string         `json:"receiving_warehouse_name"`
	ReceivingWarehouseID   int64          `json:"receiving_warehouse_id"`
	Status                 TransferStatus `json:"status"`
	CreatedAt              time.Time      `json:"created_at"`
}

type GetTransferOutboundRequestsRow

type GetTransferOutboundRequestsRow struct {
	ID                   int64          `json:"id"`
	SendingWarehouseName string         `json:"sending_warehouse_name"`
	Status               TransferStatus `json:"status"`
	CreatedAt            time.Time      `json:"created_at"`
}

type GetTransferTotalLiabilityAndReceivingIdParams

type GetTransferTotalLiabilityAndReceivingIdParams struct {
	ID                 int64 `json:"id"`
	SendingWarehouseID int64 `json:"sending_warehouse_id"`
}

type GetTransferTotalLiabilityAndReceivingIdRow

type GetTransferTotalLiabilityAndReceivingIdRow struct {
	ReceivingWarehouseID int64 `json:"receiving_warehouse_id"`
	TotalLiability       int64 `json:"total_liability"`
}

type GetTransferTotalLiabilityAndSendingIdParams

type GetTransferTotalLiabilityAndSendingIdParams struct {
	ID                   int64 `json:"id"`
	ReceivingWarehouseID int64 `json:"receiving_warehouse_id"`
}

type GetTransferTotalLiabilityAndSendingIdRow

type GetTransferTotalLiabilityAndSendingIdRow struct {
	SendingWarehouseID int64 `json:"sending_warehouse_id"`
	TotalLiability     int64 `json:"total_liability"`
}

type GetTransfersRow

type GetTransfersRow struct {
	ID                     int64          `json:"id"`
	ReceivingWarehouseName string         `json:"receiving_warehouse_name"`
	SendingWarehouseName   string         `json:"sending_warehouse_name"`
	ReceivingWarehouseID   int64          `json:"receiving_warehouse_id"`
	SendingWarehouseID     int64          `json:"sending_warehouse_id"`
	Status                 TransferStatus `json:"status"`
	CreatedAt              time.Time      `json:"created_at"`
}

type GetUserSessionInfoParams

type GetUserSessionInfoParams struct {
	UserID   int64 `json:"user_id"`
	WalletID int64 `json:"wallet_id"`
}

type GetUserSessionInfoRow

type GetUserSessionInfoRow struct {
	Username        string      `json:"username"`
	PrimaryWalletID pgtype.Int8 `json:"primary_wallet_id"`
	WalletAddress   string      `json:"wallet_address"`
	WalletUserID    int64       `json:"wallet_user_id"`
}

type GetUserSessionRow

type GetUserSessionRow struct {
	ID       int64 `json:"id"`
	UserID   int64 `json:"user_id"`
	WalletID int64 `json:"wallet_id"`
}

type GetUserSessionsRow

type GetUserSessionsRow struct {
	ID       int64 `json:"id"`
	UserID   int64 `json:"user_id"`
	WalletID int64 `json:"wallet_id"`
}

type GetWalletIdAndWebhookByAddressRow

type GetWalletIdAndWebhookByAddressRow struct {
	ID      int64       `json:"id"`
	Webhook pgtype.Text `json:"webhook"`
}

type GetWarehouseAssetsRow

type GetWarehouseAssetsRow struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	Value    int64  `json:"value"`
	Quantity int64  `json:"quantity"`
}

type GetWarehouseCollateralLiabilityAndRatioLockRow

type GetWarehouseCollateralLiabilityAndRatioLockRow struct {
	Collateral      int64          `json:"collateral"`
	Liability       int64          `json:"liability"`
	CollateralRatio pgtype.Numeric `json:"collateral_ratio"`
}

type GetWarehouseCollateralLiabilityAndRatioRow

type GetWarehouseCollateralLiabilityAndRatioRow struct {
	Collateral      int64          `json:"collateral"`
	Liability       int64          `json:"liability"`
	CollateralRatio pgtype.Numeric `json:"collateral_ratio"`
}

type GetWarehouseWorkersRow

type GetWarehouseWorkersRow struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
}

type GetWarehousesCollateralTotalsRow

type GetWarehousesCollateralTotalsRow struct {
	WarehouseAssetsTotal   int64 `json:"warehouse_assets_total"`
	TransferredAssetsTotal int64 `json:"transferred_assets_total"`
}

type InsertTransferParams

type InsertTransferParams struct {
	CreatedAt            time.Time      `json:"created_at"`
	Status               TransferStatus `json:"status"`
	SendingWarehouseID   int64          `json:"sending_warehouse_id"`
	ReceivingWarehouseID int64          `json:"receiving_warehouse_id"`
}

type InsertUserParams

type InsertUserParams struct {
	Username  string    `json:"username"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
}

type InsertUserSessionParams

type InsertUserSessionParams struct {
	Key      string `json:"key"`
	UserID   int64  `json:"user_id"`
	WalletID int64  `json:"wallet_id"`
}

type InsertWalletParams

type InsertWalletParams struct {
	Address string `json:"address"`
	UserID  int64  `json:"user_id"`
}

type InsertWarehouseParams

type InsertWarehouseParams struct {
	Name     string      `json:"name"`
	UserID   int64       `json:"user_id"`
	Location interface{} `json:"location"`
}

type InsertWarehouseWorkerByUsernameParams

type InsertWarehouseWorkerByUsernameParams struct {
	WarehouseID int64  `json:"warehouse_id"`
	Username    string `json:"username"`
}

type InsertWarehouseWorkerParams

type InsertWarehouseWorkerParams struct {
	WarehouseID int64 `json:"warehouse_id"`
	UserID      int64 `json:"user_id"`
}

type NullTransferStatus

type NullTransferStatus struct {
	TransferStatus TransferStatus `json:"transfer_status"`
	Valid          bool           `json:"valid"` // Valid is true if TransferStatus is not NULL
}

func (*NullTransferStatus) Scan

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

Scan implements the Scanner interface.

func (NullTransferStatus) Value

func (ns NullTransferStatus) 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) AddWalletAssetQuantity

func (q *Queries) AddWalletAssetQuantity(ctx context.Context, arg AddWalletAssetQuantityParams) (int64, error)

func (*Queries) AddWarehouseAssetQuantity

func (q *Queries) AddWarehouseAssetQuantity(ctx context.Context, arg AddWarehouseAssetQuantityParams) (int64, error)

func (*Queries) AddWarehouseCollateral

func (q *Queries) AddWarehouseCollateral(ctx context.Context, arg AddWarehouseCollateralParams) (int64, error)

func (*Queries) AddWarehouseLiability

func (q *Queries) AddWarehouseLiability(ctx context.Context, arg AddWarehouseLiabilityParams) error

func (*Queries) CountAssignedWallet

func (q *Queries) CountAssignedWallet(ctx context.Context, arg CountAssignedWalletParams) (int64, error)

func (*Queries) CountWalletsByIdAndUserId

func (q *Queries) CountWalletsByIdAndUserId(ctx context.Context, arg CountWalletsByIdAndUserIdParams) (int64, error)

func (*Queries) CreateAsset

func (q *Queries) CreateAsset(ctx context.Context, arg CreateAssetParams) error

func (*Queries) CreateTransaction

func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (int64, error)

func (*Queries) CreateTransactionAsset

func (q *Queries) CreateTransactionAsset(ctx context.Context, arg CreateTransactionAssetParams) error

func (*Queries) CreateTransferAssets

func (*Queries) CreateWallet

func (q *Queries) CreateWallet(ctx context.Context, arg CreateWalletParams) error

func (*Queries) CreateWalletAsset

func (q *Queries) CreateWalletAsset(ctx context.Context, arg CreateWalletAssetParams) error

func (*Queries) CreateWalletSession

func (q *Queries) CreateWalletSession(ctx context.Context, arg CreateWalletSessionParams) error

func (*Queries) CreateWalletUser

func (q *Queries) CreateWalletUser(ctx context.Context, arg CreateWalletUserParams) error

func (*Queries) CreateWarehouseAsset

func (q *Queries) CreateWarehouseAsset(ctx context.Context, arg CreateWarehouseAssetParams) error

func (*Queries) DeleteAsset

func (q *Queries) DeleteAsset(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteSessionsByUserId

func (q *Queries) DeleteSessionsByUserId(ctx context.Context, userID int64) error

func (*Queries) DeleteUserSessionByUserIdAndWalletId

func (q *Queries) DeleteUserSessionByUserIdAndWalletId(ctx context.Context, arg DeleteUserSessionByUserIdAndWalletIdParams) error

func (*Queries) DeleteWallet

func (q *Queries) DeleteWallet(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteWalletAsset

func (q *Queries) DeleteWalletAsset(ctx context.Context, arg DeleteWalletAssetParams) (int64, error)

func (*Queries) DeleteWalletAssets

func (q *Queries) DeleteWalletAssets(ctx context.Context, walletID int64) (int64, error)

func (*Queries) DeleteWalletSession

func (q *Queries) DeleteWalletSession(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteWalletSessionsByWalletId

func (q *Queries) DeleteWalletSessionsByWalletId(ctx context.Context, walletID int64) error

func (*Queries) DeleteWalletUser

func (q *Queries) DeleteWalletUser(ctx context.Context, arg DeleteWalletUserParams) error

func (*Queries) DeleteWalletWebhook

func (q *Queries) DeleteWalletWebhook(ctx context.Context, id int64) error

func (*Queries) DeleteWarehouseWorker

func (q *Queries) DeleteWarehouseWorker(ctx context.Context, arg DeleteWarehouseWorkerParams) error

func (*Queries) ExistsWarehouseWorker

func (q *Queries) ExistsWarehouseWorker(ctx context.Context, arg ExistsWarehouseWorkerParams) (bool, error)

func (*Queries) ExistsWarehouseWorkerByUsername

func (q *Queries) ExistsWarehouseWorkerByUsername(ctx context.Context, arg ExistsWarehouseWorkerByUsernameParams) (bool, error)

func (*Queries) GetAssetIdByName

func (q *Queries) GetAssetIdByName(ctx context.Context, name string) (int64, error)

func (*Queries) GetAssetsByIds

func (q *Queries) GetAssetsByIds(ctx context.Context, dollar_1 []int64) ([]Asset, error)

func (*Queries) GetAssetsByNames

func (q *Queries) GetAssetsByNames(ctx context.Context, dollar_1 []string) ([]Asset, error)

func (*Queries) GetAssetsIdNameByNames

func (q *Queries) GetAssetsIdNameByNames(ctx context.Context, dollar_1 []string) ([]GetAssetsIdNameByNamesRow, error)

func (*Queries) GetAssignedUsersByWalletId

func (q *Queries) GetAssignedUsersByWalletId(ctx context.Context, walletID int64) ([]GetAssignedUsersByWalletIdRow, error)

func (*Queries) GetAssignedWalletsByUserId

func (q *Queries) GetAssignedWalletsByUserId(ctx context.Context, userID int64) ([]GetAssignedWalletsByUserIdRow, error)

func (*Queries) GetTransactionAssetsByTransactionIds

func (q *Queries) GetTransactionAssetsByTransactionIds(ctx context.Context, dollar_1 []int64) ([]TransactionAsset, error)

func (*Queries) GetTransactions

func (q *Queries) GetTransactions(ctx context.Context, arg GetTransactionsParams) ([]Transaction, error)

func (*Queries) GetTransactionsDetailed

func (q *Queries) GetTransactionsDetailed(ctx context.Context, arg GetTransactionsDetailedParams) ([]GetTransactionsDetailedRow, error)

func (*Queries) GetTransferAssets

func (q *Queries) GetTransferAssets(ctx context.Context, arg GetTransferAssetsParams) ([]GetTransferAssetsRow, error)

func (*Queries) GetTransferAssetsByTransferId

func (q *Queries) GetTransferAssetsByTransferId(ctx context.Context, transferID int64) ([]GetTransferAssetsByTransferIdRow, error)

func (*Queries) GetTransferInboundRequests

func (q *Queries) GetTransferInboundRequests(ctx context.Context, sendingWarehouseID int64) ([]GetTransferInboundRequestsRow, error)

func (*Queries) GetTransferOutboundRequests

func (q *Queries) GetTransferOutboundRequests(ctx context.Context, receivingWarehouseID int64) ([]GetTransferOutboundRequestsRow, error)

func (*Queries) GetTransfers

func (q *Queries) GetTransfers(ctx context.Context, warehouseID int64) ([]GetTransfersRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, username string) (User, error)

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, id int64) (User, error)

func (*Queries) GetUserCanCreateWarehouses

func (q *Queries) GetUserCanCreateWarehouses(ctx context.Context, id int64) (bool, error)

func (*Queries) GetUserIdByUsername

func (q *Queries) GetUserIdByUsername(ctx context.Context, username string) (int64, error)

func (*Queries) GetUserSession

func (q *Queries) GetUserSession(ctx context.Context, key string) (GetUserSessionRow, error)

func (*Queries) GetUserSessionInfo

func (q *Queries) GetUserSessionInfo(ctx context.Context, arg GetUserSessionInfoParams) (GetUserSessionInfoRow, error)

func (*Queries) GetUserSessions

func (q *Queries) GetUserSessions(ctx context.Context, userID int64) ([]GetUserSessionsRow, error)

func (*Queries) GetUserWalletId

func (q *Queries) GetUserWalletId(ctx context.Context, userID int64) (pgtype.Int8, error)

func (*Queries) GetWalletAssets

func (q *Queries) GetWalletAssets(ctx context.Context, walletID int64) ([]WalletAsset, error)

func (*Queries) GetWalletByUsername

func (q *Queries) GetWalletByUsername(ctx context.Context, username string) (pgtype.Int8, error)

func (*Queries) GetWalletIdAndWebhookByAddress

func (q *Queries) GetWalletIdAndWebhookByAddress(ctx context.Context, address string) (GetWalletIdAndWebhookByAddressRow, error)

func (*Queries) GetWalletSession

func (q *Queries) GetWalletSession(ctx context.Context, key string) (int64, error)

func (*Queries) GetWalletSessionsByWalletId

func (q *Queries) GetWalletSessionsByWalletId(ctx context.Context, walletID int64) ([]WalletSession, error)

func (*Queries) GetWalletWebhook

func (q *Queries) GetWalletWebhook(ctx context.Context, id int64) (pgtype.Text, error)

func (*Queries) GetWalletsByUserId

func (q *Queries) GetWalletsByUserId(ctx context.Context, userID int64) ([]Wallet, error)

func (*Queries) GetWarehouseAssets

func (q *Queries) GetWarehouseAssets(ctx context.Context, warehouseID int64) ([]GetWarehouseAssetsRow, error)

func (*Queries) GetWarehouseCollateralLiabilityAndRatio

func (q *Queries) GetWarehouseCollateralLiabilityAndRatio(ctx context.Context, id int64) (GetWarehouseCollateralLiabilityAndRatioRow, error)

func (*Queries) GetWarehouseCollateralLiabilityAndRatioLock

func (q *Queries) GetWarehouseCollateralLiabilityAndRatioLock(ctx context.Context, id int64) (GetWarehouseCollateralLiabilityAndRatioLockRow, error)

func (*Queries) GetWarehouseUserId

func (q *Queries) GetWarehouseUserId(ctx context.Context, id int64) (int64, error)

func (*Queries) GetWarehouseWorkers

func (q *Queries) GetWarehouseWorkers(ctx context.Context, warehouseID int64) ([]GetWarehouseWorkersRow, error)

func (*Queries) GetWarehousesCollateralTotals

func (q *Queries) GetWarehousesCollateralTotals(ctx context.Context, receivingWarehouseID int64) (GetWarehousesCollateralTotalsRow, error)

func (*Queries) InsertTransfer

func (q *Queries) InsertTransfer(ctx context.Context, arg InsertTransferParams) (int64, error)

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (int64, error)

func (*Queries) InsertUserSession

func (q *Queries) InsertUserSession(ctx context.Context, arg InsertUserSessionParams) error

func (*Queries) InsertWallet

func (q *Queries) InsertWallet(ctx context.Context, arg InsertWalletParams) (int64, error)

func (*Queries) InsertWarehouse

func (q *Queries) InsertWarehouse(ctx context.Context, arg InsertWarehouseParams) (int64, error)

func (*Queries) InsertWarehouseWorker

func (q *Queries) InsertWarehouseWorker(ctx context.Context, arg InsertWarehouseWorkerParams) error

func (*Queries) InsertWarehouseWorkerByUsername

func (q *Queries) InsertWarehouseWorkerByUsername(ctx context.Context, arg InsertWarehouseWorkerByUsernameParams) error

func (*Queries) SubtractWalletAssetQuantity

func (q *Queries) SubtractWalletAssetQuantity(ctx context.Context, arg SubtractWalletAssetQuantityParams) (int64, error)

func (*Queries) SubtractWarehouseAssetQuantity

func (q *Queries) SubtractWarehouseAssetQuantity(ctx context.Context, arg SubtractWarehouseAssetQuantityParams) (int64, error)

func (*Queries) SubtractWarehouseCollateral

func (q *Queries) SubtractWarehouseCollateral(ctx context.Context, arg SubtractWarehouseCollateralParams) (int64, error)

func (*Queries) SubtractWarehouseLiability

func (q *Queries) SubtractWarehouseLiability(ctx context.Context, arg SubtractWarehouseLiabilityParams) error

func (*Queries) UpdateAssetName

func (q *Queries) UpdateAssetName(ctx context.Context, arg UpdateAssetNameParams) (int64, error)

func (*Queries) UpdateAssetValue

func (q *Queries) UpdateAssetValue(ctx context.Context, arg UpdateAssetValueParams) (int64, error)

func (*Queries) UpdateCanCreateWarehouses

func (q *Queries) UpdateCanCreateWarehouses(ctx context.Context, arg UpdateCanCreateWarehousesParams) error

func (*Queries) UpdateTransferStatus

func (q *Queries) UpdateTransferStatus(ctx context.Context, arg UpdateTransferStatusParams) (int64, error)

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error

func (*Queries) UpdateUserSessionWallet

func (q *Queries) UpdateUserSessionWallet(ctx context.Context, arg UpdateUserSessionWalletParams) error

func (*Queries) UpdateUserSessionWalletByWalletId

func (q *Queries) UpdateUserSessionWalletByWalletId(ctx context.Context, arg UpdateUserSessionWalletByWalletIdParams) error

func (*Queries) UpdateUserUsername

func (q *Queries) UpdateUserUsername(ctx context.Context, arg UpdateUserUsernameParams) error

func (*Queries) UpdateUserWallet

func (q *Queries) UpdateUserWallet(ctx context.Context, arg UpdateUserWalletParams) (int64, error)

func (*Queries) UpdateWalletUserID

func (q *Queries) UpdateWalletUserID(ctx context.Context, arg UpdateWalletUserIDParams) error

func (*Queries) UpdateWalletUserUserID

func (q *Queries) UpdateWalletUserUserID(ctx context.Context, arg UpdateWalletUserUserIDParams) (int64, error)

func (*Queries) UpdateWalletWebhook

func (q *Queries) UpdateWalletWebhook(ctx context.Context, arg UpdateWalletWebhookParams) error

func (*Queries) UpdateWarehouseLiability

func (q *Queries) UpdateWarehouseLiability(ctx context.Context, arg UpdateWarehouseLiabilityParams) (int64, error)

func (*Queries) UpdateWarehouseUserIdByUsername

func (q *Queries) UpdateWarehouseUserIdByUsername(ctx context.Context, arg UpdateWarehouseUserIdByUsernameParams) error

func (*Queries) WithTx

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

type SubtractWalletAssetQuantityParams

type SubtractWalletAssetQuantityParams struct {
	Quantity int64 `json:"quantity"`
	WalletID int64 `json:"wallet_id"`
	AssetID  int64 `json:"asset_id"`
}

type SubtractWarehouseAssetQuantityParams

type SubtractWarehouseAssetQuantityParams struct {
	Quantity    int64 `json:"quantity"`
	WarehouseID int64 `json:"warehouse_id"`
	AssetID     int64 `json:"asset_id"`
}

type SubtractWarehouseCollateralParams

type SubtractWarehouseCollateralParams struct {
	Collateral int64 `json:"collateral"`
	ID         int64 `json:"id"`
}

type SubtractWarehouseLiabilityParams

type SubtractWarehouseLiabilityParams struct {
	Liability int64 `json:"liability"`
	ID        int64 `json:"id"`
}

type Transaction

type Transaction struct {
	ID                int64       `json:"id"`
	SendingWalletID   int64       `json:"sending_wallet_id"`
	ReceivingWalletID int64       `json:"receiving_wallet_id"`
	CreatedAt         time.Time   `json:"created_at"`
	Memo              pgtype.Text `json:"memo"`
}

type TransactionAsset

type TransactionAsset struct {
	ID            int64 `json:"id"`
	TransactionID int64 `json:"transaction_id"`
	AssetID       int64 `json:"asset_id"`
	Quantity      int64 `json:"quantity"`
}

type Transfer

type Transfer struct {
	ID                   int64          `json:"id"`
	CreatedAt            time.Time      `json:"created_at"`
	Status               TransferStatus `json:"status"`
	SendingWarehouseID   int64          `json:"sending_warehouse_id"`
	ReceivingWarehouseID int64          `json:"receiving_warehouse_id"`
}

type TransferAsset

type TransferAsset struct {
	ID         int64 `json:"id"`
	TransferID int64 `json:"transfer_id"`
	AssetID    int64 `json:"asset_id"`
	Quantity   int64 `json:"quantity"`
}

type TransferStatus

type TransferStatus string
const (
	TransferStatusOpen     TransferStatus = "open"
	TransferStatusDeclined TransferStatus = "declined"
	TransferStatusApproved TransferStatus = "approved"
	TransferStatusCleared  TransferStatus = "cleared"
)

func (*TransferStatus) Scan

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

type UpdateAssetNameParams

type UpdateAssetNameParams struct {
	Name string `json:"name"`
	ID   int64  `json:"id"`
}

type UpdateAssetValueParams

type UpdateAssetValueParams struct {
	Value int64 `json:"value"`
	ID    int64 `json:"id"`
}

type UpdateCanCreateWarehousesParams

type UpdateCanCreateWarehousesParams struct {
	CanCreateWarehouses bool   `json:"can_create_warehouses"`
	Username            string `json:"username"`
}

type UpdateTransferStatusParams

type UpdateTransferStatusParams struct {
	Status             TransferStatus `json:"status"`
	ID                 int64          `json:"id"`
	SendingWarehouseID int64          `json:"sending_warehouse_id"`
	Status_2           TransferStatus `json:"status_2"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	Password string `json:"password"`
	ID       int64  `json:"id"`
}

type UpdateUserSessionWalletByWalletIdParams

type UpdateUserSessionWalletByWalletIdParams struct {
	NewWalletID int64 `json:"new_wallet_id"`
	OldWalletID int64 `json:"old_wallet_id"`
}

type UpdateUserSessionWalletParams

type UpdateUserSessionWalletParams struct {
	WalletID int64 `json:"wallet_id"`
	ID       int64 `json:"id"`
}

type UpdateUserUsernameParams

type UpdateUserUsernameParams struct {
	Username string `json:"username"`
	ID       int64  `json:"id"`
}

type UpdateUserWalletParams

type UpdateUserWalletParams struct {
	WalletID pgtype.Int8 `json:"wallet_id"`
	ID       int64       `json:"id"`
}

type UpdateWalletUserIDParams

type UpdateWalletUserIDParams struct {
	UserID   int64 `json:"user_id"`
	ID       int64 `json:"id"`
	UserID_2 int64 `json:"user_id_2"`
}

type UpdateWalletUserUserIDParams

type UpdateWalletUserUserIDParams struct {
	UserID   int64 `json:"user_id"`
	WalletID int64 `json:"wallet_id"`
	UserID_2 int64 `json:"user_id_2"`
}

type UpdateWalletWebhookParams

type UpdateWalletWebhookParams struct {
	Webhook pgtype.Text `json:"webhook"`
	ID      int64       `json:"id"`
}

type UpdateWarehouseLiabilityParams

type UpdateWarehouseLiabilityParams struct {
	Liability int64 `json:"liability"`
	ID        int64 `json:"id"`
}

type UpdateWarehouseUserIdByUsernameParams

type UpdateWarehouseUserIdByUsernameParams struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
}

type User

type User struct {
	ID                  int64       `json:"id"`
	Username            string      `json:"username"`
	Password            string      `json:"password"`
	CreatedAt           time.Time   `json:"created_at"`
	WalletID            pgtype.Int8 `json:"wallet_id"`
	CanCreateWarehouses bool        `json:"can_create_warehouses"`
}

type UserSession

type UserSession struct {
	ID       int64  `json:"id"`
	UserID   int64  `json:"user_id"`
	WalletID int64  `json:"wallet_id"`
	Key      string `json:"key"`
}

type Wallet

type Wallet struct {
	ID      int64       `json:"id"`
	Address string      `json:"address"`
	UserID  int64       `json:"user_id"`
	Webhook pgtype.Text `json:"webhook"`
}

type WalletAsset

type WalletAsset struct {
	ID       int64 `json:"id"`
	WalletID int64 `json:"wallet_id"`
	AssetID  int64 `json:"asset_id"`
	Quantity int64 `json:"quantity"`
}

type WalletSession

type WalletSession struct {
	ID       int64       `json:"id"`
	WalletID int64       `json:"wallet_id"`
	Name     pgtype.Text `json:"name"`
	Key      string      `json:"key"`
}

type WalletUser

type WalletUser struct {
	ID       int64 `json:"id"`
	WalletID int64 `json:"wallet_id"`
	UserID   int64 `json:"user_id"`
}

type Warehouse

type Warehouse struct {
	ID              int64          `json:"id"`
	Name            string         `json:"name"`
	UserID          int64          `json:"user_id"`
	Location        interface{}    `json:"location"`
	Liability       int64          `json:"liability"`
	Collateral      int64          `json:"collateral"`
	CollateralRatio pgtype.Numeric `json:"collateral_ratio"`
}

type WarehouseAsset

type WarehouseAsset struct {
	ID          int64 `json:"id"`
	WarehouseID int64 `json:"warehouse_id"`
	AssetID     int64 `json:"asset_id"`
	Quantity    int64 `json:"quantity"`
}

type WarehouseWorker

type WarehouseWorker struct {
	ID          int64 `json:"id"`
	WarehouseID int64 `json:"warehouse_id"`
	UserID      int64 `json:"user_id"`
}

Jump to

Keyboard shortcuts

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