upload

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const UploadNotFoundErrorName = "UploadNotFound"

Variables

View Source
var ErrUploadNotFound = errors.New(UploadNotFoundErrorName, "upload not found")

ErrUploadNotFound indicates an upload does not exist.

Functions

This section is empty.

Types

type ListConfig

type ListConfig = store.PaginationConfig

type ListOption

type ListOption func(cfg *ListConfig)

func WithListCursor

func WithListCursor(cursor string) ListOption

func WithListLimit

func WithListLimit(limit int) ListOption

type ListShardsConfig

type ListShardsConfig = store.PaginationConfig

type ListShardsOption

type ListShardsOption func(cfg *ListShardsConfig)

func WithListShardsCursor

func WithListShardsCursor(cursor string) ListShardsOption

func WithListShardsLimit

func WithListShardsLimit(limit int) ListShardsOption

type Store

type Store interface {
	Exists(ctx context.Context, space did.DID, root cid.Cid) (bool, error)
	// May return [ErrUploadNotFound] if the upload does not exist.
	Get(ctx context.Context, space did.DID, root cid.Cid) (UploadRecord, error)
	Inspect(ctx context.Context, root cid.Cid) (UploadInspectRecord, error)
	List(ctx context.Context, space did.DID, options ...ListOption) (store.Page[UploadRecord], error)
	// Lists the shards of an upload.
	ListShards(ctx context.Context, space did.DID, root cid.Cid, options ...ListShardsOption) (store.Page[cid.Cid], error)
	// Removes an item from the table but fails if the item does not exist.
	Remove(ctx context.Context, space did.DID, root cid.Cid) error
	// Inserts an item in the table if it does not already exist or updates an
	// existing item if it does exist.
	Upsert(ctx context.Context, space did.DID, root cid.Cid, shards []cid.Cid, cause cid.Cid) error
}

type UploadInspectRecord

type UploadInspectRecord struct {
	Spaces []did.DID
}

type UploadRecord

type UploadRecord struct {
	Space      did.DID
	Root       cid.Cid
	Cause      cid.Cid
	InsertedAt time.Time
	UpdatedAt  time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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