cbor

package
v2.7.2-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 5 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoerceInterfaceMapToStringMap

func CoerceInterfaceMapToStringMap(in interface{}) (interface{}, error)

CoerceInterfaceMapToStringMap converts map[interface{}]interface{} (interface maps) to map[string]interface{} (string maps) and []interface{} with interface maps to string maps. Relevant when serializing between CBOR and JSON.

It also handles the CBOR 'bignum' type as documented here: https://tools.ietf.org/html/rfc7049#section-2.4.2

func ParseDietCBOR

func ParseDietCBOR(b []byte) (map[string]interface{}, error)

ParseDietCBOR attempts to coerce the input byte array into valid CBOR. Assumes the input is "diet" CBOR which is like CBOR, except: 1. It is guaranteed to always be a map 2. It may or may not include the opening and closing markers "{}"

func ParseDietCBORToStruct added in v2.3.0

func ParseDietCBORToStruct(b []byte, v interface{}) error

Similar to ParseDietCBOR but outputs to a concrete struct, which meets the "top-level map" requirement of "diet" CBOR.

func ParseStandardCBOR

func ParseStandardCBOR(b []byte) (a interface{}, err error)

ParseStandardCBOR parses CBOR in "standards compliant" mode. Literal values are passed through "as-is". The input is not assumed to be a map. Empty inputs will return nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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