Documentation ¶
Index ¶
- Constants
- Variables
- func CborTypeExtract(b []byte) (string, error)
- func CborTypeExtractReader(r io.Reader) (string, []byte, error)
- func JsonDecodeValue(b []byte) (any, error)
- func NewFromType(typ string) (interface{}, error)
- func RegisterType(id string, val cbg.CBORMarshaler)
- func TypeExtract(b []byte) (string, error)
- type BlobSchema
- type CBOR
- type CborChecker
- type JsonBytes
- type LegacyBlob
- type LexBlob
- type LexBytes
- type LexLink
- type LexiconTypeDecoder
Constants ¶
View Source
const ( // TODO: this is an arbitrary size. lexicons can set more realistic limits, // and we should pass those limits through and only fall back to this when // undefined. MAX_BYTE_ARRAY_SIZE = 128 * 1024 * 1024 )
Variables ¶
View Source
var ErrUnrecognizedType = fmt.Errorf("unrecognized lexicon type")
Functions ¶
func CborTypeExtract ¶
func JsonDecodeValue ¶
func NewFromType ¶
func RegisterType ¶
func RegisterType(id string, val cbg.CBORMarshaler)
func TypeExtract ¶
Types ¶
type BlobSchema ¶
type BlobSchema struct { LexiconTypeID string `json:"$type,const=blob" cborgen:"$type,const=blob"` Ref LexLink `json:"ref" cborgen:"ref"` MimeType string `json:"mimeType" cborgen:"mimeType"` Size int64 `json:"size" cborgen:"size"` }
func (*BlobSchema) MarshalCBOR ¶
func (t *BlobSchema) MarshalCBOR(w io.Writer) error
func (*BlobSchema) UnmarshalCBOR ¶
func (t *BlobSchema) UnmarshalCBOR(r io.Reader) (err error)
type CborChecker ¶
type CborChecker struct {
Type string `json:"$type" cborgen:"$type"`
}
func (*CborChecker) MarshalCBOR ¶
func (t *CborChecker) MarshalCBOR(w io.Writer) error
func (*CborChecker) UnmarshalCBOR ¶
func (t *CborChecker) UnmarshalCBOR(r io.Reader) (err error)
type LegacyBlob ¶
type LegacyBlob struct { Cid string `json:"cid" cborgen:"cid"` MimeType string `json:"mimeType" cborgen:"mimeType"` }
func (*LegacyBlob) MarshalCBOR ¶
func (t *LegacyBlob) MarshalCBOR(w io.Writer) error
func (*LegacyBlob) UnmarshalCBOR ¶
func (t *LegacyBlob) UnmarshalCBOR(r io.Reader) (err error)
type LexBlob ¶
used in schemas, and can represent either a legacy blob or a "new" (lex refactor) blob. size=-1 indicates that this is (and should be serialized as) a legacy blob (string CID, no size, etc).
func (LexBlob) MarshalJSON ¶
func (*LexBlob) UnmarshalJSON ¶
type LexiconTypeDecoder ¶
type LexiconTypeDecoder struct {
Val cbg.CBORMarshaler
}
func (*LexiconTypeDecoder) MarshalJSON ¶
func (ltd *LexiconTypeDecoder) MarshalJSON() ([]byte, error)
func (*LexiconTypeDecoder) UnmarshalJSON ¶
func (ltd *LexiconTypeDecoder) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.