dataset

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0, MIT Imports: 15 Imported by: 0 modules, 0 packages

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 AddPieceHandler

func AddPieceHandler(
	db *gorm.DB,
	datasetName string,
	request AddPieceRequest,
) (*model.Car, *handler.Error)

AddPieceHandler godoc @Summary Manually register a piece (CAR file) with the dataset for deal making purpose @Tags Dataset Piece @Produce json @Accept json @Param datasetName path string true "Dataset name" @Param request body AddPieceRequest true "Request body" @Success 200 {object} model.Car @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName}/piece [post]

func CreateHandler

func CreateHandler(
	db *gorm.DB,
	request CreateRequest,
) (*model.Dataset, *handler.Error)

CreateHandler godoc @Summary Create a new dataset @Tags Dataset @Accept json @Produce json @Description The dataset is a top level object to distinguish different dataset. @Param request body CreateRequest true "Request body" @Success 200 {object} model.Dataset @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset [post]

func ListHandler

func ListHandler(
	db *gorm.DB,
) ([]model.Dataset, *handler.Error)

ListHandler godoc @Summary List all datasets @Tags Dataset @Produce json @Success 200 {array} model.Dataset @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /datasets [get]

func ListPiecesHandler

func ListPiecesHandler(
	db *gorm.DB,
	datasetName string,
) ([]model.Car, *handler.Error)

ListPiecesHandler godoc @Summary List all pieces for the dataset that are available for deal making" @Tags Dataset Piece @Produce json @Accept json @Param datasetName path string true "Dataset name" @Success 200 {array} model.Car @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName}/pieces [get]

func RemoveHandler

func RemoveHandler(
	db *gorm.DB,
	datasetName string,
) *handler.Error

RemoveHandler godoc @Summary Remove a specific dataset. This will not remove the CAR files. @Description Important! If the dataset is large, this command will take some time to remove all relevant data. @Tags Dataset @Param datasetName path string true "Dataset name" @Success 204 @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName} [delete]

func UpdateHandler

func UpdateHandler(
	db *gorm.DB,
	datasetName string,
	request UpdateRequest,
) (*model.Dataset, *handler.Error)

UpdateHandler godoc @Summary Update a dataset @Tags Dataset @Accept json @Produce json @Param datasetName path string true "Dataset name" @Param request body UpdateRequest true "Request body" @Success 200 {object} model.Dataset @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName} [patch]

Types

type AddPieceRequest

type AddPieceRequest struct {
	PieceCID  string `json:"pieceCid"`
	PieceSize string `json:"pieceSize"`
	FilePath  string `json:"filePath"`
	RootCID   string `json:"rootCid"`
}

type CreateRequest

type CreateRequest struct {
	Name                 string   `json:"name"                 validate:"required"`                     // Name must be a unique identifier for a dataset
	MaxSizeStr           string   `default:"31.5GiB"           json:"maxSize"      validate:"required"` // Maximum size of the CAR files to be created
	PieceSizeStr         string   `default:""                  json:"pieceSize"    validate:"optional"` // Target piece size of the CAR files used for piece commitment calculation
	OutputDirs           []string `json:"outputDirs"           validate:"optional"`                     // Output directory for CAR files. Do not set if using inline preparation
	EncryptionRecipients []string `json:"encryptionRecipients" validate:"optional"`                     // Public key of the encryption recipient
	EncryptionScript     string   `json:"encryptionScript"     validate:"optional"`                     // EncryptionScript command to run for custom encryption
}

type UpdateRequest

type UpdateRequest struct {
	MaxSizeStr           *string  `default:"31.5GiB"           json:"maxSize"      validate:"optional"` // Maximum size of the CAR files to be created
	PieceSizeStr         *string  `default:""                  json:"pieceSize"    validate:"optional"` // Target piece size of the CAR files used for piece commitment calculation
	OutputDirs           []string `json:"outputDirs"           validate:"optional"`                     // Output directory for CAR files. Do not set if using inline preparation
	EncryptionRecipients []string `json:"encryptionRecipients" validate:"optional"`                     // Public key of the encryption recipient
	EncryptionScript     *string  `json:"encryptionScript"     validate:"optional"`                     // EncryptionScript command to run for custom encryption
}

Jump to

Keyboard shortcuts

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