Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.9 kB · 55 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.media.origin
package placestream
import ( "encoding/json" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
func init() { glex.RegisterType("place.stream.media.origin", &MediaOrigin{})}
// An attestation that a MUXL blob is available for download from the publishing node, retrievable via XRPC (com.atproto.repo.getBlob and similar). Published by the Streamplace node that hosts the blob, not by the user who owns the underlying video. The rkey is conventionally the blob's BDASL CID — atproto lexicon doesn't yet have a literal-rkey syntax so we settle for `key: any` and rely on the convention.type MediaOrigin struct { LexiconTypeID string `json:"$type,omitempty"` // blob: BLAKE-3 content hash (BDASL CID) of the blob. Blob string `json:"blob"` // mimeType: MIME type of the blob (e.g. video/mp4). MimeType string `json:"mimeType"` // size: Size of the blob in bytes. Size int64 `json:"size"`}
// RecordTypeID implements glex.Record.func (t *MediaOrigin) RecordTypeID() string { return "place.stream.media.origin" }
// MarshalJSON stamps the $type field, like MarshalCBOR does. The value// receiver operates on a copy, so the record is never mutated and both// MediaOrigin and *MediaOrigin marshal with $type.func (t MediaOrigin) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "place.stream.media.origin" type alias MediaOrigin return json.Marshal((alias)(t))}
func (t *MediaOrigin) 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.media.origin" return glex.MarshalCBOR(w, &cp)}
func (t *MediaOrigin) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}