An unofficial terminal client for Tangled, optimized for humans and agents. tgcli.wisp.place
cli atproto go tangled
Something went wrong. Try again.
2.3 kB · 84 lines
Go
at master
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
// Lexicon schema: sh.tangled.feed.comment
package tangledlex
import ( "bytes" "encoding/json" "fmt" "io"
comatproto "github.com/bluesky-social/indigo/api/atproto" lexutil "github.com/bluesky-social/indigo/lex/util" cbg "github.com/whyrusleeping/cbor-gen")
func init() { lexutil.RegisterType("sh.tangled.feed.comment", &FeedComment{})}
type FeedComment struct { LexiconTypeID string `json:"$type" cborgen:"$type,const=sh.tangled.feed.comment"` Body *FeedComment_Body `json:"body" cborgen:"body"` CreatedAt string `json:"createdAt" cborgen:"createdAt"` // pullRoundIdx: optional pull submission round index. required when subject is sh.tangled.repo.pull PullRoundIdx *int64 `json:"pullRoundIdx,omitempty" cborgen:"pullRoundIdx,omitempty"` ReplyTo *comatproto.RepoStrongRef `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` Subject *comatproto.RepoStrongRef `json:"subject" cborgen:"subject"`}
type FeedComment_Body struct { MarkupMarkdown *MarkupMarkdown}
func (t *FeedComment_Body) MarshalJSON() ([]byte, error) { if t.MarkupMarkdown != nil { t.MarkupMarkdown.LexiconTypeID = "sh.tangled.markup.markdown" return json.Marshal(t.MarkupMarkdown) } return nil, fmt.Errorf("can not marshal empty union as JSON")}
func (t *FeedComment_Body) UnmarshalJSON(b []byte) error { typ, err := lexutil.TypeExtract(b) if err != nil { return err }
switch typ { case "sh.tangled.markup.markdown": t.MarkupMarkdown = new(MarkupMarkdown) return json.Unmarshal(b, t.MarkupMarkdown) default: return nil }}
func (t *FeedComment_Body) MarshalCBOR(w io.Writer) error {
if t == nil { _, err := w.Write(cbg.CborNull) return err } if t.MarkupMarkdown != nil { return t.MarkupMarkdown.MarshalCBOR(w) } return fmt.Errorf("can not marshal empty union as CBOR")}
func (t *FeedComment_Body) UnmarshalCBOR(r io.Reader) error { typ, b, err := lexutil.CborTypeExtractReader(r) if err != nil { return err }
switch typ { case "sh.tangled.markup.markdown": t.MarkupMarkdown = new(MarkupMarkdown) return t.MarkupMarkdown.UnmarshalCBOR(bytes.NewReader(b)) default: return nil }}