cbor

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package cbor contains a codec implementation that marshals in CBOR format.

Index

Constants

This section is empty.

Variables

View Source
var DefaultCodec = Codec{}

DefaultCodec is a marshalkit.Codec that marshals messages using CBOR encoding.

Functions

This section is empty.

Types

type Codec

type Codec struct{}

Codec is an implementation of marshalkit.Codec that uses CBOR encoding.

func (Codec) BasicMediaType

func (Codec) BasicMediaType() string

BasicMediaType returns the type and subtype portion of the media-type used to identify data encoded by this codec.

func (Codec) Marshal

func (Codec) Marshal(v any) ([]byte, error)

Marshal returns the binary representation of v.

func (Codec) Query

func (Codec) Query(types []reflect.Type) codec.Capabilities

Query returns the capabilities of the codec for the given types.

func (Codec) Unmarshal

func (Codec) Unmarshal(data []byte, v any) error

Unmarshal decodes a binary representation into v.

Jump to

Keyboard shortcuts

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