schedule

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHandler

func CreateHandler(
	db *gorm.DB,
	request CreateRequest,
) (*model.Schedule, *handler.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, *handler.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, *handler.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, *handler.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"`
	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"`
	AllowedPieceCIDs     []string      `json:"allowedPieceCIDs"`
}

Jump to

Keyboard shortcuts

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