deal

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListHandler

func ListHandler(db *gorm.DB, request ListDealRequest) ([]model.Deal, *handler.Error)

ListHandler godoc @Summary List all deals @Description List all deals @Tags Deal @Accept json @Produce json @Param request body ListDealRequest true "ListDealRequest" @Success 200 {array} model.Deal @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /deal/list [post]

func SendManualHandler

func SendManualHandler(
	db *gorm.DB,
	request Proposal,
) (string, *handler.Error)

SendManualHandler godoc @Summary Send a manual deal proposal @Description Send a manual deal proposal @Tags Deal @Accept json @Produce json @Param proposal body Proposal true "Proposal" @Success 200 {string} string @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /deal/send_manual [post]

Types

type ListDealRequest

type ListDealRequest struct {
	Datasets  []string `json:"datasets"`
	Schedules []uint32 `json:"schedules"`
	Providers []string `json:"providers"`
	States    []string `json:"states"`
}

type Proposal

type Proposal struct {
	HTTPHeaders    []string `json:"httpHeaders"`
	URLTemplate    string   `json:"urlTemplate"`
	Price          float64  `json:"price"`
	RootCID        string   `json:"rootCID"`
	Verified       bool     `json:"verified"`
	IPNI           bool     `json:"ipni"`
	KeepUnsealed   bool     `json:"keepUnsealed"`
	StartDelayDays float64  `json:"startDelayDays"`
	DurationDays   float64  `json:"durationDays"`
	ClientAddress  string   `json:"clientAddress"`
	ProviderID     string   `json:"providerID"`
	PieceCID       string   `json:"pieceCID"`
	PieceSize      string   `json:"pieceSize"`
	FileSize       uint64   `json:"fileSize"`
	LotusAPI       string   `swaggerignore:"true"`
	LotusToken     string   `swaggerignore:"true"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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