Documentation
¶
Index ¶
- func CreateHandler(db *gorm.DB, request CreateRequest) (*model.Schedule, error)
- func ListHandler(db *gorm.DB) ([]model.Schedule, error)
- func PauseHandler(db *gorm.DB, scheduleID string) (*model.Schedule, error)
- func ResumeHandler(db *gorm.DB, scheduleID string) (*model.Schedule, error)
- type CreateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶
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 ¶
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 ¶
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 ¶
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"`
Provider string `json:"provider"`
HTTPHeaders []string `json:"httpHeaders"`
URLTemplate string `json:"urlTemplate"`
Price float64 `json:"price"`
Verified bool `json:"verified"`
IPNI bool `json:"ipni"`
KeepUnsealed bool `json:"keepUnsealed"`
ScheduleInterval time.Duration `json:"scheduleInterval"`
StartDelayDays float64 `json:"startDelayDays"`
DurationDays float64 `json:"durationDays"`
ScheduleDealNumber int `json:"scheduleDealNumber"`
TotalDealNumber int `json:"totalDealNumber"`
ScheduleDealSize string `json:"scheduleDealSize"`
TotalDealSize string `json:"totalDealSize"`
Notes string `json:"notes"`
MaxPendingDealSize string `json:"maxPendingDealSize"`
MaxPendingDealNumber int `json:"maxPendingDealNumber"`
//nolint:tagliatelle
AllowedPieceCIDs []string `json:"allowedPieceCids"`
}