db

package
v0.0.0-...-269d6e4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuctionDatum

type AuctionDatum struct {
	ID         string         `json:"id"`
	BatchID    broker.BatchID `json:"batchID"`
	PayloadCid string         `json:"payloadCid"`
	PieceCid   string         `json:"pieceCid"`
	PieceSize  uint64         `json:"pieceSize"`
	Duration   uint64         `json:"duration"`
	CreatedAt  time.Time      `json:"createdAt"`
	CarUrl     string         `json:"carUrl"`
}

type AuctionDeal

type AuctionDeal struct {
	ID                  string         `json:"id"`
	AuctionDataID       string         `json:"auctionDataID"`
	StorageProviderID   string         `json:"storageProviderID"`
	PricePerGibPerEpoch int64          `json:"pricePerGibPerEpoch"`
	StartEpoch          uint64         `json:"startEpoch"`
	Verified            bool           `json:"verified"`
	FastRetrieval       bool           `json:"fastRetrieval"`
	AuctionID           auction.ID     `json:"auctionID"`
	BidID               auction.BidID  `json:"bidID"`
	Status              Status         `json:"status"`
	Executing           bool           `json:"executing"`
	ErrorCause          string         `json:"errorCause"`
	Retries             int            `json:"retries"`
	ProposalCid         string         `json:"proposalCid"`
	DealID              int64          `json:"dealID"`
	DealExpiration      uint64         `json:"dealExpiration"`
	ReadyAt             time.Time      `json:"readyAt"`
	CreatedAt           time.Time      `json:"createdAt"`
	UpdatedAt           time.Time      `json:"updatedAt"`
	BatchID             broker.BatchID `json:"batchID"`
	MarketDealStatus    string         `json:"marketDealStatus"`
}

type CreateAuctionDataParams

type CreateAuctionDataParams struct {
	ID         string         `json:"id"`
	BatchID    broker.BatchID `json:"batchID"`
	PayloadCid string         `json:"payloadCid"`
	PieceCid   string         `json:"pieceCid"`
	PieceSize  uint64         `json:"pieceSize"`
	Duration   uint64         `json:"duration"`
	CarUrl     string         `json:"carUrl"`
}

type CreateAuctionDealParams

type CreateAuctionDealParams struct {
	ID                  string         `json:"id"`
	AuctionDataID       string         `json:"auctionDataID"`
	BatchID             broker.BatchID `json:"batchID"`
	StorageProviderID   string         `json:"storageProviderID"`
	PricePerGibPerEpoch int64          `json:"pricePerGibPerEpoch"`
	StartEpoch          uint64         `json:"startEpoch"`
	Verified            bool           `json:"verified"`
	FastRetrieval       bool           `json:"fastRetrieval"`
	AuctionID           auction.ID     `json:"auctionID"`
	BidID               auction.BidID  `json:"bidID"`
	Status              Status         `json:"status"`
	Executing           bool           `json:"executing"`
	ErrorCause          string         `json:"errorCause"`
	Retries             int            `json:"retries"`
	ProposalCid         string         `json:"proposalCid"`
	DealID              int64          `json:"dealID"`
	DealExpiration      uint64         `json:"dealExpiration"`
	MarketDealStatus    string         `json:"marketDealStatus"`
	ReadyAt             time.Time      `json:"readyAt"`
}

type CreateRemoteWalletParams

type CreateRemoteWalletParams struct {
	AuctionDataID string   `json:"auctionDataID"`
	PeerID        string   `json:"peerID"`
	AuthToken     string   `json:"authToken"`
	WalletAddr    string   `json:"walletAddr"`
	Multiaddrs    []string `json:"multiaddrs"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type MarketDealStatus

type MarketDealStatus struct {
	ID          int64  `json:"id"`
	Description string `json:"description"`
	Type        string `json:"type"`
}

@enum

type NextPendingAuctionDealParams

type NextPendingAuctionDealParams struct {
	Status       Status `json:"status"`
	StuckSeconds int64  `json:"stuckSeconds"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CreateAuctionData

func (q *Queries) CreateAuctionData(ctx context.Context, arg CreateAuctionDataParams) error

func (*Queries) CreateAuctionDeal

func (q *Queries) CreateAuctionDeal(ctx context.Context, arg CreateAuctionDealParams) error

func (*Queries) CreateRemoteWallet

func (q *Queries) CreateRemoteWallet(ctx context.Context, arg CreateRemoteWalletParams) error

func (*Queries) GetAllMarketDealStatuses

func (q *Queries) GetAllMarketDealStatuses(ctx context.Context) ([]MarketDealStatus, error)

func (*Queries) GetAuctionData

func (q *Queries) GetAuctionData(ctx context.Context, id string) (AuctionDatum, error)

func (*Queries) GetAuctionDeal

func (q *Queries) GetAuctionDeal(ctx context.Context, id string) (AuctionDeal, error)

func (*Queries) GetAuctionDealIDs

func (q *Queries) GetAuctionDealIDs(ctx context.Context, auctionDataID string) ([]string, error)

func (*Queries) GetAuctionDealsByStatus

func (q *Queries) GetAuctionDealsByStatus(ctx context.Context, status Status) ([]AuctionDeal, error)

func (*Queries) GetMarketDealStatusForID

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

func (*Queries) GetMarketDealStatusForType

func (q *Queries) GetMarketDealStatusForType(ctx context.Context, t string) (MarketDealStatus, error)

func (*Queries) GetRemoteWallet

func (q *Queries) GetRemoteWallet(ctx context.Context, auctionDataID string) (RemoteWallet, error)

func (*Queries) NextPendingAuctionDeal

func (q *Queries) NextPendingAuctionDeal(ctx context.Context, arg NextPendingAuctionDealParams) (AuctionDeal, error)

func (*Queries) UpdateAuctionDeal

func (q *Queries) UpdateAuctionDeal(ctx context.Context, arg UpdateAuctionDealParams) (int64, error)

func (*Queries) WithTx

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

type RemoteWallet

type RemoteWallet struct {
	AuctionDataID string    `json:"auctionDataID"`
	PeerID        string    `json:"peerID"`
	AuthToken     string    `json:"authToken"`
	WalletAddr    string    `json:"walletAddr"`
	Multiaddrs    []string  `json:"multiaddrs"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
}

type Status

type Status string
const (
	StatusDealMaking      Status = "deal-making"
	StatusConfirmation    Status = "confirmation"
	StatusReportFinalized Status = "report-finalized"
	StatusFinalized       Status = "finalized"
)

func (*Status) Scan

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

type UpdateAuctionDealParams

type UpdateAuctionDealParams struct {
	AuctionDataID       string         `json:"auctionDataID"`
	BatchID             broker.BatchID `json:"batchID"`
	StorageProviderID   string         `json:"storageProviderID"`
	PricePerGibPerEpoch int64          `json:"pricePerGibPerEpoch"`
	StartEpoch          uint64         `json:"startEpoch"`
	Verified            bool           `json:"verified"`
	FastRetrieval       bool           `json:"fastRetrieval"`
	AuctionID           auction.ID     `json:"auctionID"`
	BidID               auction.BidID  `json:"bidID"`
	Status              Status         `json:"status"`
	Executing           bool           `json:"executing"`
	ErrorCause          string         `json:"errorCause"`
	Retries             int            `json:"retries"`
	ProposalCid         string         `json:"proposalCid"`
	DealID              int64          `json:"dealID"`
	DealExpiration      uint64         `json:"dealExpiration"`
	MarketDealStatus    string         `json:"marketDealStatus"`
	ReadyAt             time.Time      `json:"readyAt"`
	ID                  string         `json:"id"`
}

Jump to

Keyboard shortcuts

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