schedule

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"`
	//nolint:tagliatelle
	AllowedPieceCIDs []string `json:"allowedPieceCids"`
}

Jump to

Keyboard shortcuts

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