Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.8 kB · 52 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.metadata.configuration
package placestream
import ( "encoding/json" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
func init() { glex.RegisterType("place.stream.metadata.configuration", &MetadataConfiguration{})}
// Default metadata record for livestream including content warnings, rights, and distribution policytype MetadataConfiguration struct { LexiconTypeID string `json:"$type,omitempty"` ContentRights *MetadataContentRights `json:"contentRights,omitempty"` ContentWarnings *MetadataContentWarnings `json:"contentWarnings,omitempty"` DistributionPolicy *MetadataDistributionPolicy `json:"distributionPolicy,omitempty"`}
// RecordTypeID implements glex.Record.func (t *MetadataConfiguration) RecordTypeID() string { return "place.stream.metadata.configuration" }
// MarshalJSON stamps the $type field, like MarshalCBOR does. The value// receiver operates on a copy, so the record is never mutated and both// MetadataConfiguration and *MetadataConfiguration marshal with $type.func (t MetadataConfiguration) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "place.stream.metadata.configuration" type alias MetadataConfiguration return json.Marshal((alias)(t))}
func (t *MetadataConfiguration) 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.metadata.configuration" return glex.MarshalCBOR(w, &cp)}
func (t *MetadataConfiguration) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}