{"modulePath":"github.com/data-preservation-programs/singularity","version":"v0.3.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package dataset\n\n## Functions\n\n```go\nfunc AddPieceHandler(\n\tctx context.Context,\n\tdb *gorm.DB,\n\tdatasetName string,\n\trequest AddPieceRequest,\n) (*model.Car, error)\n```\n\n```go\nfunc CreateHandler(\n\tctx context.Context,\n\tdb *gorm.DB,\n\trequest CreateRequest,\n) (*model.Dataset, error)\n```\n\n```go\nfunc ListHandler(\n\tctx context.Context,\n\tdb *gorm.DB,\n) ([]model.Dataset, error)\n```\n\n```go\nfunc ListPiecesHandler(\n\tctx context.Context,\n\tdb *gorm.DB,\n\tdatasetName string,\n) ([]model.Car, error)\n```\n\n```go\nfunc RemoveHandler(\n\tctx context.Context,\n\tdb *gorm.DB,\n\tdatasetName string,\n) error\n```\n\n```go\nfunc UpdateHandler(\n\tctx context.Context,\n\tdb *gorm.DB,\n\tdatasetName string,\n\trequest UpdateRequest,\n) (*model.Dataset, error)\n```\n\n## Types\n\n```go\ntype AddPieceRequest struct {\n\tPieceCID  string `json:\"pieceCid\"`  // CID of the piece\n\tPieceSize string `json:\"pieceSize\"` // Size of the piece\n\tFilePath  string `json:\"filePath\"`  // Path to the CAR file, used to determine the size of the file and root CID\n\tRootCID   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\n}\n```\n\n```go\ntype CreateRequest struct {\n\tName                 string   `json:\"name\"                 validate:\"required\"`                     // Name must be a unique identifier for a dataset\n\tMaxSizeStr           string   `default:\"31.5GiB\"           json:\"maxSize\"      validate:\"required\"` // Maximum size of the CAR files to be created\n\tPieceSizeStr         string   `default:\"\"                  json:\"pieceSize\"    validate:\"optional\"` // Target piece size of the CAR files used for piece commitment calculation\n\tOutputDirs           []string `json:\"outputDirs\"           validate:\"optional\"`                     // Output directory for CAR files. Do not set if using inline preparation\n\tEncryptionRecipients []string `json:\"encryptionRecipients\" validate:\"optional\"`                     // Public key of the encryption recipient\n}\n```\n\n```go\ntype UpdateRequest struct {\n\tMaxSizeStr           *string  `default:\"31.5GiB\"           json:\"maxSize\"      validate:\"optional\"` // Maximum size of the CAR files to be created\n\tPieceSizeStr         *string  `default:\"\"                  json:\"pieceSize\"    validate:\"optional\"` // Target piece size of the CAR files used for piece commitment calculation\n\tOutputDirs           []string `json:\"outputDirs\"           validate:\"optional\"`                     // Output directory for CAR files. Do not set if using inline preparation\n\tEncryptionRecipients []string `json:\"encryptionRecipients\" validate:\"optional\"`                     // Public key of the encryption recipient\n}\n```\n\n","path":"github.com/data-preservation-programs/singularity/handler/dataset","name":"dataset","synopsis":"","isRedistributable":true}
