Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.5 kB · 55 lines
Go
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556// Code generated by glex; DO NOT EDIT.
// Lexicon schema: place.stream.key
package placestream
import ( "encoding/json" "io"
glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen")
func init() { glex.RegisterType("place.stream.key", &Key{})}
// Record linking an atproto identity with a stream signing keytype Key struct { LexiconTypeID string `json:"$type,omitempty"` // createdAt: Client-declared timestamp when this key was created. CreatedAt string `json:"createdAt"` // createdBy: The name of the client that created this key. CreatedBy *string `json:"createdBy,omitempty"` // signingKey: The did:key signing key for the stream. SigningKey string `json:"signingKey"`}
// RecordTypeID implements glex.Record.func (t *Key) RecordTypeID() string { return "place.stream.key" }
// MarshalJSON stamps the $type field, like MarshalCBOR does. The value// receiver operates on a copy, so the record is never mutated and both// Key and *Key marshal with $type.func (t Key) MarshalJSON() ([]byte, error) { t.LexiconTypeID = "place.stream.key" type alias Key return json.Marshal((alias)(t))}
func (t *Key) 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.key" return glex.MarshalCBOR(w, &cp)}
func (t *Key) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t)}