at main 71 lines 3.1 kB view raw
1package lex 2 3import ( 4 "github.com/bluesky-social/indigo/lex/util" 5) 6 7func init() { 8 util.RegisterType("org.xcvr.actor.profile", &ProfileRecord{}) 9 util.RegisterType("org.xcvr.feed.channel", &ChannelRecord{}) 10 util.RegisterType("org.xcvr.lrc.message", &MessageRecord{}) 11 util.RegisterType("org.xcvr.lrc.signet", &SignetRecord{}) 12} 13 14type ProfileRecord struct { 15 LexiconTypeID string `json:"$type,const=org.xcvr.actor.profile" cborgen:"$type,const=org.xcvr.actor.profile"` 16 DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 17 DefaultNick *string `json:"defaultNick,omitempty" cborgen:"defaultNick,omitempty"` 18 Status *string `json:"status,omitempty" cborgen:"status,omitempty"` 19 Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 20 Color *uint64 `json:"color,omitempty" cborgen:"color,omitempty"` 21} 22 23type ChannelRecord struct { 24 LexiconTypeID string `json:"$type,const=org.xcvr.feed.channel" cborgen:"$type,const=org.xcvr.feed.channel"` 25 Title string `json:"title" cborgen:"title"` 26 Topic *string `json:"topic,omitempty" cborgen:"topic,omitempty"` 27 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 28 Host string `json:"host" cborgen:"host"` 29} 30 31type MessageRecord struct { 32 LexiconTypeID string `json:"$type,const=org.xcvr.lrc.message" cborgen:"$type,const=org.xcvr.lrc.message"` 33 SignetURI string `json:"signetURI" cborgen:"signetURI"` 34 Body string `json:"body" cborgen:"body"` 35 Nick *string `json:"nick,omitempty" cborgen:"nick,omitempty"` 36 Color *uint64 `json:"color,omitempty" cborgen:"color,omitempty"` 37 PostedAt string `json:"postedAt" cborgen:"postedAt"` 38} 39 40type SignetRecord struct { 41 LexiconTypeID string `json:"$type,const=org.xcvr.lrc.signet" cborgen:"$type,const=org.xcvr.lrc.signet"` 42 ChannelURI string `json:"channelURI" cborgen:"channelURI"` 43 LRCID uint64 `json:"lrcID" cborgen:"lrcID"` 44 AuthorHandle string `json:"authorHandle" cborgen:"authorHandle"` 45 StartedAt *string `json:"startedAt,omitempty" cborgen:"startedAt,omitempty"` 46} 47 48type MediaRecord struct { 49 LexiconTypeID string `json:"$type,const=org.xcvr.lrc.media" cborgen:"$type,const=org.xcvr.lrc.media"` 50 SignetURI string `json:"signetURI" cborgen:"signetURI"` 51 Media Media `json:"media" cborgen:"media"` 52 Nick *string `json:"nick,omitempty" cborgen:"nick,omitempty"` 53 Color *uint64 `json:"color,omitempty" cborgen:"color,omitempty"` 54 PostedAt string `json:"postedAt" cborgen:"postedAt"` 55} 56 57type Media struct { 58 Image *Image 59} 60 61type Image struct { 62 LexiconTypeID string `json:"$type,const=org.xcvr.lrc.image" cborgen:"$type,const=org.xcvr.lrc.image"` 63 Alt string `json:"alt" cborgen:"alt"` 64 AspectRatio *AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"` 65 Image *util.BlobSchema `json:"image,omitempty" cborgen:"image,omitempty"` 66} 67 68type AspectRatio struct { 69 Height int64 `json:"height" cborgen:"height"` 70 Width int64 `json:"width" cborgen:"width"` 71}