Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.6 kB · 53 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.live.recommendations
package placestream
import ( "encoding/json" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
func init() { glex.RegisterType("place.stream.live.recommendations", &LiveRecommendations{})}
// A list of recommended streamers, in order of preferencetype LiveRecommendations struct { LexiconTypeID string `json:"$type,omitempty"` // createdAt: Client-declared timestamp when this list was created. CreatedAt string `json:"createdAt"` // streamers: Ordered list of recommended streamer DIDs Streamers []string `json:"streamers"`}
// RecordTypeID implements glex.Record.func (t *LiveRecommendations) RecordTypeID() string { return "place.stream.live.recommendations" }
// MarshalJSON stamps the $type field, like MarshalCBOR does. The value// receiver operates on a copy, so the record is never mutated and both// LiveRecommendations and *LiveRecommendations marshal with $type.func (t LiveRecommendations) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "place.stream.live.recommendations" type alias LiveRecommendations return json.Marshal((alias)(t))}
func (t *LiveRecommendations) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.live.recommendations" return glex.MarshalCBOR(w, &cp)}
func (t *LiveRecommendations) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}