Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.8 kB · 53 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.playback.getLiveToken
package placestream
import ( "context" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
type PlaybackGetLiveToken_Output struct { LexiconTypeID string `json:"$type,omitempty"` // expiresAt: When the token stops working; fetch a new one before then. ExpiresAt string `json:"expiresAt"` // token: Opaque token to pass as the `token` query parameter. Token string `json:"token"`}
// RecordTypeID implements glex.Record.func (t *PlaybackGetLiveToken_Output) RecordTypeID() string { return "place.stream.playback.getLiveToken"}
func (t *PlaybackGetLiveToken_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.playback.getLiveToken" return glex.MarshalCBOR(w, &cp)}
func (t *PlaybackGetLiveToken_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}
// PlaybackGetLiveToken calls the XRPC method "place.stream.playback.getLiveToken".//// Mint a short-lived playback token for the caller's own live stream, so their player can watch it over HLS before it is published (pre-live). HLS requests carry no session; the token, passed as `token` on getLivePlaylist and getLiveSegment, stands in for one. Requires an authenticated session; the token is bound to the caller's DID.func PlaybackGetLiveToken(ctx context.Context, c glex.LexClient) (*PlaybackGetLiveToken_Output, error) { var out PlaybackGetLiveToken_Output
if err := c.LexDo(ctx, glex.Query, "", "place.stream.playback.getLiveToken", nil, nil, &out); err != nil { return nil, err } return &out, nil}