···
return syntax.ATURI(fmt.Sprintf("at://%s/%s/%s", i.OwnerDid, tangled.RepoIssueNSID, i.Rkey))
func NewIssue(tx *sql.Tx, issue *Issue) error {
···
row_num between ? and ?`,
repoAt, openValue, page.Offset+1, page.Offset+page.Limit)
···
return syntax.ATURI(fmt.Sprintf("at://%s/%s/%s", i.OwnerDid, tangled.RepoIssueNSID, i.Rkey))
+
func IssueFromRecord(did, rkey string, record tangled.RepoIssue) Issue {
+
created, err := time.Parse(time.RFC3339, record.CreatedAt)
+
if record.Body != nil {
+
RepoAt: syntax.ATURI(record.Repo),
+
OwnerDid: record.Owner,
+
Open: true, // new issues are open by default
+
func ResolveIssueFromAtUri(e Execer, issueUri syntax.ATURI) (syntax.ATURI, int, error) {
+
ownerDid := issueUri.Authority().String()
+
issueRkey := issueUri.RecordKey().String()
+
query := `select repo_at, issue_id from issues where owner_did = ? and rkey = ?`
+
err := e.QueryRow(query, ownerDid, issueRkey).Scan(&repoAt, &issueId)
+
return syntax.ATURI(repoAt), issueId, nil
+
func IssueCommentFromRecord(e Execer, did, rkey string, record tangled.RepoIssueComment) (Comment, error) {
+
created, err := time.Parse(time.RFC3339, record.CreatedAt)
+
if record.Owner != nil {
+
ownerDid = *record.Owner
+
issueUri, err := syntax.ParseATURI(record.Issue)
+
repoAt, issueId, err := ResolveIssueFromAtUri(e, issueUri)
func NewIssue(tx *sql.Tx, issue *Issue) error {
···
row_num between ? and ?`,
repoAt, openValue, page.Offset+1, page.Offset+page.Limit)