cbor

package
v1.4.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 5 Imported by: 0

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 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