store

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateError

type AggregateError struct {
	Errors []error
}

func (AggregateError) Error

func (a AggregateError) Error() string

type ItemBlock

type ItemBlock struct {
	PieceOffset   int64               `json:"pieceOffset"`
	SourceHandler datasource.Handler  `json:"-"`
	Item          *model.Item         `json:"item"`
	Meta          []ItemBlockMetadata `json:"meta"`
}

func (ItemBlock) GetPieceOffset

func (i ItemBlock) GetPieceOffset() int64

type ItemBlockMetadata

type ItemBlockMetadata struct {
	PieceOffset int64   `json:"pieceOffset"`
	Varint      []byte  `json:"varint"`
	Cid         cid.Cid `json:"cid"`
	ItemOffset  int64   `json:"itemOffset"`
	ItemLength  int32   `json:"itemLength"`
}

func (ItemBlockMetadata) BlockOffset

func (i ItemBlockMetadata) BlockOffset() int64

func (ItemBlockMetadata) CidOffset

func (i ItemBlockMetadata) CidOffset() int64

func (ItemBlockMetadata) EndOffset

func (i ItemBlockMetadata) EndOffset() int64

func (ItemBlockMetadata) GetPieceOffset

func (i ItemBlockMetadata) GetPieceOffset() int64

func (ItemBlockMetadata) Length

func (i ItemBlockMetadata) Length() int

type ItemReferenceBlockStore

type ItemReferenceBlockStore struct {
	DB              *gorm.DB
	HandlerResolver datasource.HandlerResolver
}

func (ItemReferenceBlockStore) AllKeysChan

func (i ItemReferenceBlockStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

func (ItemReferenceBlockStore) DeleteBlock

func (i ItemReferenceBlockStore) DeleteBlock(ctx context.Context, cid cid.Cid) error

func (ItemReferenceBlockStore) Get

func (i ItemReferenceBlockStore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error)

func (ItemReferenceBlockStore) GetSize

func (i ItemReferenceBlockStore) GetSize(ctx context.Context, c cid.Cid) (int, error)

func (ItemReferenceBlockStore) Has

func (i ItemReferenceBlockStore) Has(ctx context.Context, cid cid.Cid) (bool, error)

func (ItemReferenceBlockStore) HashOnRead

func (i ItemReferenceBlockStore) HashOnRead(enabled bool)

func (ItemReferenceBlockStore) Put

func (ItemReferenceBlockStore) PutMany

type PieceBlock

type PieceBlock interface {
	GetPieceOffset() int64
}

type PieceReader

type PieceReader struct {
	Blocks []PieceBlock `json:"blocks"`

	Header []byte `json:"header"`
	// contains filtered or unexported fields
}

func NewPieceReader

func NewPieceReader(
	ctx context.Context,
	car model.Car,
	carBlocks []model.CarBlock,
	resolver datasource.HandlerResolver,
) (
	*PieceReader,
	error,
)

func (*PieceReader) Close

func (pr *PieceReader) Close() error

func (*PieceReader) MakeCopy

func (pr *PieceReader) MakeCopy(ctx context.Context, offset int64) (*PieceReader, error)

func (*PieceReader) Read

func (pr *PieceReader) Read(p []byte) (n int, err error)

type RawBlock

type RawBlock struct {
	PieceOffset int64   `json:"pieceOffset"`
	Varint      []byte  `json:"varint"`
	Cid         cid.Cid `json:"cid"`
	BlockData   []byte  `json:"blockData"`
}

func (RawBlock) BlockOffset

func (r RawBlock) BlockOffset() int64

func (RawBlock) CidOffset

func (r RawBlock) CidOffset() int64

func (RawBlock) EndOffset

func (r RawBlock) EndOffset() int64

func (RawBlock) GetPieceOffset

func (r RawBlock) GetPieceOffset() int64

func (RawBlock) Length

func (r RawBlock) Length() int

Jump to

Keyboard shortcuts

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