schedule

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0, MIT Imports: 12 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(
	ctx context.Context,
	db *gorm.DB,
	lotusClient jsonrpc.RPCClient,
	request CreateRequest,
) (*model.Schedule, error)

func ListByDatasetHandler added in v0.3.1

func ListByDatasetHandler(
	ctx context.Context,
	db *gorm.DB,
	datasetName string,
) ([]model.Schedule, error)

func ListHandler

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

func PauseHandler

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

func ResumeHandler

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

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:"12840h"            json:"duration"`        // Duration in epoch or in duration format, i.e. 1500000, 2400h
	ScheduleCron          string   `json:"scheduleCron"`                                // Schedule cron patter
	ScheduleCronPerpetual bool     `json:"scheduleCronPerpetual"`                       // Whether a cron schedule should run in definitely
	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