Documentation ¶
Index ¶
- Constants
- Variables
- func BlockDiff(ctx context.Context, bs blockstore.Blockstore, oldroot cid.Cid, ...) (map[cid.Cid]bool, error)
- func LdWrite(w io.Writer, d ...[]byte) (int64, error)
- func WriteCarHeader(w io.Writer, root cid.Cid) (int64, error)
- type CarShard
- type CarStore
- func (cs *CarStore) CompactUserShards(ctx context.Context, user models.Uid, skipBigShards bool) (*CompactionStats, error)
- func (cs *CarStore) GetCompactionTargets(ctx context.Context, shardCount int) ([]CompactionTarget, error)
- func (cs *CarStore) GetUserRepoHead(ctx context.Context, user models.Uid) (cid.Cid, error)
- func (cs *CarStore) GetUserRepoRev(ctx context.Context, user models.Uid) (string, error)
- func (cs *CarStore) ImportSlice(ctx context.Context, uid models.Uid, since *string, carslice []byte) (cid.Cid, *DeltaSession, error)
- func (cs *CarStore) NewDeltaSession(ctx context.Context, user models.Uid, since *string) (*DeltaSession, error)
- func (cs *CarStore) ReadOnlySession(user models.Uid) (*DeltaSession, error)
- func (cs *CarStore) ReadUserCar(ctx context.Context, user models.Uid, sinceRev string, incremental bool, ...) error
- func (cs *CarStore) Stat(ctx context.Context, usr models.Uid) ([]UserStat, error)
- func (cs *CarStore) WipeUserData(ctx context.Context, user models.Uid) error
- type CompactionStats
- type CompactionTarget
- type DeltaSession
- func (ds *DeltaSession) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (ds *DeltaSession) BaseCid() cid.Cid
- func (ds *DeltaSession) CalcDiff(ctx context.Context, skipcids map[cid.Cid]bool) error
- func (ds *DeltaSession) CloseWithRoot(ctx context.Context, root cid.Cid, rev string) ([]byte, error)
- func (ds *DeltaSession) DeleteBlock(ctx context.Context, c cid.Cid) error
- func (ds *DeltaSession) Get(ctx context.Context, c cid.Cid) (blockformat.Block, error)
- func (ds *DeltaSession) GetSize(ctx context.Context, c cid.Cid) (int, error)
- func (ds *DeltaSession) Has(ctx context.Context, c cid.Cid) (bool, error)
- func (ds *DeltaSession) HashOnRead(hor bool)
- func (ds *DeltaSession) Put(ctx context.Context, b blockformat.Block) error
- func (ds *DeltaSession) PutMany(ctx context.Context, bs []blockformat.Block) error
- type UserInfo
- type UserStat
Constants ¶
View Source
const BigShardThreshold = 2 << 20
View Source
const MaxSliceLength = 2 << 20
Variables ¶
View Source
var CacheHits int64
View Source
var CacheMiss int64
View Source
var ErrRepoBaseMismatch = fmt.Errorf("attempted a delta session on top of the wrong previous head")
Functions ¶
func BlockDiff ¶
func BlockDiff(ctx context.Context, bs blockstore.Blockstore, oldroot cid.Cid, newcids map[cid.Cid]blockformat.Block, skipcids map[cid.Cid]bool) (map[cid.Cid]bool, error)
Types ¶
type CarShard ¶
type CarShard struct { ID uint `gorm:"primarykey"` CreatedAt time.Time Root models.DbCID `gorm:"index"` DataStart int64 Seq int `gorm:"index:idx_car_shards_seq;index:idx_car_shards_usr_seq,priority:2,sort:desc"` Path string Usr models.Uid `gorm:"index:idx_car_shards_usr;index:idx_car_shards_usr_seq,priority:1"` Rev string }
type CarStore ¶
type CarStore struct {
// contains filtered or unexported fields
}
func (*CarStore) CompactUserShards ¶
func (*CarStore) GetCompactionTargets ¶
func (*CarStore) GetUserRepoHead ¶
func (*CarStore) GetUserRepoRev ¶
func (*CarStore) ImportSlice ¶
func (*CarStore) NewDeltaSession ¶
func (*CarStore) ReadOnlySession ¶
func (cs *CarStore) ReadOnlySession(user models.Uid) (*DeltaSession, error)
func (*CarStore) ReadUserCar ¶
type CompactionStats ¶
type CompactionTarget ¶
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) BaseCid ¶
func (ds *DeltaSession) BaseCid() cid.Cid
func (*DeltaSession) CalcDiff ¶
func (ds *DeltaSession) CalcDiff(ctx context.Context, skipcids map[cid.Cid]bool) error
func (*DeltaSession) CloseWithRoot ¶
func (ds *DeltaSession) CloseWithRoot(ctx context.Context, root cid.Cid, rev string) ([]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) (blockformat.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 blockformat.Block) error
func (*DeltaSession) PutMany ¶
func (ds *DeltaSession) PutMany(ctx context.Context, bs []blockformat.Block) error
Click to show internal directories.
Click to hide internal directories.