this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add repo diff method

+32
+32
repo/repo.go
··· 34 34 type Repo struct { 35 35 sr SignedRoot 36 36 cst cbor.IpldStore 37 + bs blockstore.Blockstore 37 38 38 39 meta Meta 39 40 ··· 82 83 83 84 return &Repo{ 84 85 cst: cst, 86 + bs: bs, 85 87 mst: t, 86 88 dirty: true, 87 89 } ··· 97 99 98 100 return &Repo{ 99 101 sr: sr, 102 + bs: bs, 100 103 cst: cst, 101 104 }, nil 102 105 } ··· 206 209 207 210 return nil 208 211 } 212 + 213 + func (r *Repo) DiffSince(ctx context.Context, oldrepo cid.Cid) ([]*mst.DiffOp, error) { 214 + otherRepo, err := OpenRepo(ctx, r.bs, oldrepo) 215 + if err != nil { 216 + return nil, err 217 + } 218 + 219 + oldmst, err := otherRepo.getMst(ctx) 220 + if err != nil { 221 + return nil, err 222 + } 223 + 224 + oldptr, err := oldmst.GetPointer(ctx) 225 + if err != nil { 226 + return nil, err 227 + } 228 + 229 + curmst, err := r.getMst(ctx) 230 + if err != nil { 231 + return nil, err 232 + } 233 + 234 + curptr, err := curmst.GetPointer(ctx) 235 + if err != nil { 236 + return nil, err 237 + } 238 + 239 + return mst.DiffTrees(ctx, r.bs, oldptr, curptr) 240 + }