Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
2.7 kB · 89 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.multistream.listTargets
package placestream
import ( "context" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
type MultistreamListTargets_Output struct { LexiconTypeID string `json:"$type,omitempty"` Cursor *string `json:"cursor,omitempty"` Targets []MultistreamDefs_TargetView `json:"targets"`}
// RecordTypeID implements glex.Record.func (t *MultistreamListTargets_Output) RecordTypeID() string { return "place.stream.multistream.listTargets"}
func (t *MultistreamListTargets_Output) 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.multistream.listTargets" return glex.MarshalCBOR(w, &cp)}
func (t *MultistreamListTargets_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// MultistreamListTargets calls the XRPC method "place.stream.multistream.listTargets".//// List a range of targets for rebroadcasting a Streamplace stream.//// limit: The number of targets to return.func MultistreamListTargets(ctx context.Context, c glex.LexClient, cursor string, limit *int64) (*MultistreamListTargets_Output, error) { var out MultistreamListTargets_Output
params := map[string]interface{}{} if cursor != "" { params["cursor"] = cursor } if limit != nil { params["limit"] = *limit }
if err := c.LexDo(ctx, glex.Query, "", "place.stream.multistream.listTargets", params, nil, &out); err != nil { return nil, err } return &out, nil}
// MultistreamListTargets_Record is a "record" in the place.stream.multistream.listTargets schema.type MultistreamListTargets_Record struct { LexiconTypeID string `json:"$type,omitempty"` Cid string `json:"cid"` Uri string `json:"uri"` Value *glex.LexiconTypeDecoder `json:"value"`}
// RecordTypeID implements glex.Record.func (t *MultistreamListTargets_Record) RecordTypeID() string { return "place.stream.multistream.listTargets#record"}
func (t *MultistreamListTargets_Record) 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.multistream.listTargets#record" return glex.MarshalCBOR(w, &cp)}
func (t *MultistreamListTargets_Record) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}