schedule

package
v0.2.26 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(
	db *gorm.DB,
	ctx context.Context,
	lotusClient jsonrpc.RPCClient,
	request CreateRequest,
) (*model.Schedule, error)

CreateHandler godoc @Summary Create a new schedule @Description Create a new schedule @Tags Deal Schedule @Accept json @Produce json @Param schedule body CreateRequest true "CreateRequest" @Success 200 {object} model.Schedule @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /deal/schedule [post]

func ListHandler

func ListHandler(
	db *gorm.DB,
) ([]model.Schedule, error)

ListHandler godoc @Summary List all deal making schedules @Tags Deal Schedule @Produce json @Success 200 {array} model.Schedule @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /deal/schedules [get]

func PauseHandler

func PauseHandler(
	db *gorm.DB,
	scheduleID string,
) (*model.Schedule, error)

PauseHandler godoc @Summary Pause a specific schedule @Tags Deal Schedule @Produce json @Param scheduleID path string true "Schedule ID" @Success 200 {object} model.Schedule @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /deal/schedule/{scheduleID}/pause [post]

func ResumeHandler

func ResumeHandler(
	db *gorm.DB,
	scheduleID string,
) (*model.Schedule, error)

ResumeHandler godoc @Summary Resume a specific schedule @Tags Deal Schedule @Produce json @Param scheduleID path string true "Schedule ID" @Success 200 {object} model.Schedule @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /deal/schedule/{scheduleID}/resume [post]

Types

type CreateRequest

type CreateRequest struct {
	DatasetName          string   `json:"datasetName"          validation:"required"`  // Dataset name
	Provider             string   `json:"provider"             validation:"required"`  // Provider
	HTTPHeaders          []string `json:"httpHeaders"`                                 // http headers to be passed with the request (i.e. key=value)
	URLTemplate          string   `json:"urlTemplate"`                                 // URL template with PIECE_CID placeholder for boost to fetch the CAR file, i.e. http://127.0.0.1/piece/{PIECE_CID}.car
	PricePerGBEpoch      float64  `default:"0"                 json:"pricePerGbEpoch"` // Price in FIL per GiB per epoch
	PricePerGB           float64  `default:"0"                 json:"pricePerGb"`      // Price in FIL  per GiB
	PricePerDeal         float64  `default:"0"                 json:"pricePerDeal"`    // Price in FIL per deal
	Verified             bool     `default:"true"              json:"verified"`        // Whether the deal should be verified
	IPNI                 bool     `default:"true"              json:"ipni"`            // Whether the deal should be IPNI
	KeepUnsealed         bool     `default:"true"              json:"keepUnsealed"`    // Whether the deal should be kept unsealed
	StartDelay           string   `default:"72h"               json:"startDelay"`      // Deal start delay in epoch or in duration format, i.e. 1000, 72h
	Duration             string   `default:"12740h"            json:"duration"`        // Duration in epoch or in duration format, i.e. 1500000, 2400h
	ScheduleInterval     string   `json:"scheduleInterval"`                            // Schedule interval in duration format, i.e. 1h
	ScheduleDealNumber   int      `json:"scheduleDealNumber"`                          // Number of deals per scheduled time
	TotalDealNumber      int      `json:"totalDealNumber"`                             // Total number of deals
	ScheduleDealSize     string   `json:"scheduleDealSize"`                            // Size of deals per schedule trigger in human readable format, i.e. 100 TiB
	TotalDealSize        string   `json:"totalDealSize"`                               // Total size of deals in human readable format, i.e. 100 TiB
	Notes                string   `json:"notes"`                                       // Notes
	MaxPendingDealSize   string   `json:"maxPendingDealSize"`                          // Max pending deal size in human readable format, i.e. 100 TiB
	MaxPendingDealNumber int      `json:"maxPendingDealNumber"`                        // Max pending deal number
	//nolint:tagliatelle
	AllowedPieceCIDs []string `json:"allowedPieceCids"` // Allowed piece CIDs in this schedule
}

Jump to

Keyboard shortcuts

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