util

package
v0.0.0-...-45ae864 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CborTypeExtract

func CborTypeExtract(b []byte) (string, error)

func CborTypeExtractReader

func CborTypeExtractReader(r io.Reader) (string, []byte, error)

func JsonDecodeValue

func JsonDecodeValue(b []byte) (any, error)

func NewFromType

func NewFromType(typ string) (interface{}, error)

func RegisterType

func RegisterType(id string, val cbg.CBORMarshaler)

func TypeExtract

func TypeExtract(b []byte) (string, error)

Types

type Blob

type Blob struct {
	Cid      string `json:"cid"`
	MimeType string `json:"mimeType"`
}

func (*Blob) MarshalCBOR

func (t *Blob) MarshalCBOR(w io.Writer) error

func (*Blob) UnmarshalCBOR

func (t *Blob) UnmarshalCBOR(r io.Reader) (err error)

type CBOR

type CBOR interface {
	cbg.CBORUnmarshaler
	cbg.CBORMarshaler
}

func CborDecodeValue

func CborDecodeValue(b []byte) (CBOR, error)

type CborChecker

type CborChecker struct {
	Type string `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 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL