Documentation ¶
Index ¶
- Constants
- Variables
- func IngestRepo(ctx context.Context, bs blockstore.Blockstore, r io.Reader) (cid.Cid, int, error)
- type Repo
- func (r *Repo) BlockStore() blockstore.Blockstore
- func (r *Repo) ForEach(ctx context.Context, prefix string, cb func(k string, v cid.Cid) error) error
- func (r *Repo) GetCommitsPath(len int) ([]cid.Cid, error)
- func (r *Repo) GetRecord(ctx context.Context, rpath string) (cid.Cid, map[string]interface{}, error)
- func (r *Repo) Head() cid.Cid
- func (r *Repo) MST() *mst.MerkleSearchTree
- func (r *Repo) MerkleSearchTree() *mst.MerkleSearchTree
- func (r *Repo) SignedCommit() SignedCommit
- type RepoItem
- type RepoSnapshot
- type SignedCommit
- type UnsignedCommit
Constants ¶
View Source
const ATP_REPO_VERSION int64 = 2
current version of repo currently implemented
Variables ¶
View Source
var ErrDoneIterating = fmt.Errorf("done iterating")
Functions ¶
func IngestRepo ¶
func IngestRepo(ctx context.Context, bs blockstore.Blockstore, r io.Reader) (cid.Cid, int, error)
Types ¶
type Repo ¶
type Repo struct { Blocks int // contains filtered or unexported fields }
func OpenRepo ¶
func OpenRepo(ctx context.Context, bs blockstore.Blockstore, root cid.Cid, size int) (*Repo, error)
func (*Repo) BlockStore ¶ added in v0.2.0
func (r *Repo) BlockStore() blockstore.Blockstore
func (*Repo) GetCommitsPath ¶ added in v0.2.0
func (*Repo) MST ¶ added in v0.2.0
func (r *Repo) MST() *mst.MerkleSearchTree
func (*Repo) MerkleSearchTree ¶ added in v0.2.0
func (r *Repo) MerkleSearchTree() *mst.MerkleSearchTree
func (*Repo) SignedCommit ¶ added in v0.2.0
func (r *Repo) SignedCommit() SignedCommit
type RepoSnapshot ¶
func (*RepoSnapshot) GetCollectionStats ¶ added in v0.2.0
func (ss *RepoSnapshot) GetCollectionStats(root string) (map[string]int, error)
func (*RepoSnapshot) LoadItems ¶ added in v0.2.0
func (ss *RepoSnapshot) LoadItems(root string) error
type SignedCommit ¶
type SignedCommit struct { Did string `cborgen:"did"` Version int64 `cborgen:"version"` Prev *cid.Cid `cborgen:"prev"` Data cid.Cid `cborgen:"data"` Sig []byte `cborgen:"sig"` }
func (*SignedCommit) MarshalCBOR ¶
func (t *SignedCommit) MarshalCBOR(w io.Writer) error
func (*SignedCommit) UnmarshalCBOR ¶
func (t *SignedCommit) UnmarshalCBOR(r io.Reader) (err error)
func (*SignedCommit) Unsigned ¶
func (sc *SignedCommit) Unsigned() *UnsignedCommit
Returns a copy of commit without the Sig field. Helpful when verifying signature.
type UnsignedCommit ¶
type UnsignedCommit struct { Did string `cborgen:"did"` Version int64 `cborgen:"version"` Prev *cid.Cid `cborgen:"prev"` Data cid.Cid `cborgen:"data"` }
func (*UnsignedCommit) MarshalCBOR ¶
func (t *UnsignedCommit) MarshalCBOR(w io.Writer) error
func (*UnsignedCommit) UnmarshalCBOR ¶
func (t *UnsignedCommit) UnmarshalCBOR(r io.Reader) (err error)
Click to show internal directories.
Click to hide internal directories.