dataset

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: 17 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(
	ctx context.Context,
	db *gorm.DB,
	datasetName string,
	request AddPieceRequest,
) (*model.Car, error)

func CreateHandler

func CreateHandler(
	ctx context.Context,
	db *gorm.DB,
	request CreateRequest,
) (*model.Dataset, error)

func ListHandler

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

func ListPiecesHandler

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

func RemoveHandler

func RemoveHandler(
	ctx context.Context,
	db *gorm.DB,
	datasetName string,
) error

func UpdateHandler

func UpdateHandler(
	ctx context.Context,
	db *gorm.DB,
	datasetName string,
	request UpdateRequest,
) (*model.Dataset, error)

Types

type AddPieceRequest

type AddPieceRequest struct {
	PieceCID  string `json:"pieceCid"`  // CID of the piece
	PieceSize string `json:"pieceSize"` // Size of the piece
	FilePath  string `json:"filePath"`  // Path to the CAR file, used to determine the size of the file and root CID
	RootCID   string `json:"rootCid"`   // Root CID of the CAR file, if not provided, will be determined by the CAR file header. Used to populate the label field of storage deal
}

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
}

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
}

Jump to

Keyboard shortcuts

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