carstore

package
v0.0.0-...-45ae864 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LdWrite

func LdWrite(w io.Writer, d ...[]byte) (int64, error)

Types

type CarShard

type CarShard struct {
	gorm.Model

	Root      string
	DataStart int64
	Seq       int `gorm:"index"`
	Path      string
	Usr       uint `gorm:"index"`
}

type CarStore

type CarStore struct {
	// contains filtered or unexported fields
}

func NewCarStore

func NewCarStore(meta *gorm.DB, root string) (*CarStore, error)

func (*CarStore) ImportSlice

func (cs *CarStore) ImportSlice(ctx context.Context, uid uint, carslice []byte) (cid.Cid, *DeltaSession, error)

func (*CarStore) NewDeltaSession

func (cs *CarStore) NewDeltaSession(ctx context.Context, user uint, prev *cid.Cid) (*DeltaSession, error)

func (*CarStore) ReadOnlySession

func (cs *CarStore) ReadOnlySession(user uint) (*DeltaSession, error)

func (*CarStore) ReadUserCar

func (cs *CarStore) ReadUserCar(ctx context.Context, user uint, until cid.Cid, incremental bool, w io.Writer) error

type DeltaSession

type DeltaSession struct {
	// contains filtered or unexported fields
}

func (*DeltaSession) AllKeysChan

func (ds *DeltaSession) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

func (*DeltaSession) CloseWithRoot

func (ds *DeltaSession) CloseWithRoot(ctx context.Context, root cid.Cid) ([]byte, error)

CloseWithRoot writes all new blocks in a car file to the writer with the given cid as the 'root'

func (*DeltaSession) DeleteBlock

func (ds *DeltaSession) DeleteBlock(ctx context.Context, c cid.Cid) error

func (*DeltaSession) Get

func (ds *DeltaSession) Get(ctx context.Context, c cid.Cid) (blocks.Block, error)

func (*DeltaSession) GetSize

func (ds *DeltaSession) GetSize(ctx context.Context, c cid.Cid) (int, error)

func (*DeltaSession) Has

func (ds *DeltaSession) Has(ctx context.Context, c cid.Cid) (bool, error)

func (*DeltaSession) HashOnRead

func (ds *DeltaSession) HashOnRead(hor bool)

func (*DeltaSession) Put

func (ds *DeltaSession) Put(ctx context.Context, b blocks.Block) error

func (*DeltaSession) PutMany

func (ds *DeltaSession) PutMany(ctx context.Context, bs []blocks.Block) error

type UserInfo

type UserInfo struct {
	gorm.Model
	Head string
}

Jump to

Keyboard shortcuts

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