Monorepo for Tangled
1package models
2
3import (
4 "fmt"
5 "time"
6
7 "github.com/bluesky-social/indigo/atproto/syntax"
8 "github.com/go-git/go-git/v5/plumbing"
9 "github.com/ipfs/go-cid"
10 "tangled.org/core/api/tangled"
11)
12
13type Artifact struct {
14 Id uint64
15 Did string
16 Rkey string
17
18 RepoAt syntax.ATURI
19 RepoDid string
20 Tag plumbing.Hash
21 CreatedAt time.Time
22
23 BlobCid cid.Cid
24 Name string
25 Size uint64
26 MimeType string
27}
28
29func (a *Artifact) ArtifactAt() syntax.ATURI {
30 return syntax.ATURI(fmt.Sprintf("at://%s/%s/%s", a.Did, tangled.RepoArtifactNSID, a.Rkey))
31}