cbor

package
v0.0.0-...-c5bcced Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

The encoding/cbor package encodes and decodes cbor data.

var lib = require('encoding/cbor');
var enc = lib.encode({ test: true });
var dec = lib.decode(enc);
console.log(enc, dec);

It is also possible to decode cbor data directly from a reader.

var lib = require('encoding/cbor');
var dec = lib.decoder(context.req.body);
var out = dec.decode();
console.log(out);

It is also possible to encode cbor data directly to a writer.

var lib = require('encoding/cbor');
var enc = lib.encoder(context.res.body);
enc.encode({ test: true });

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(orb *orbit.Orbit) interface{}

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(orb *orbit.Orbit, cdc *codec.Decoder) *Decoder

func (*Decoder) Decode

func (this *Decoder) Decode() (dec interface{})

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(orb *orbit.Orbit, cdc *codec.Encoder) *Encoder

func (*Encoder) Encode

func (this *Encoder) Encode(dec interface{})

type Module

type Module struct {
	// contains filtered or unexported fields
}

func (*Module) Decode

func (this *Module) Decode(enc interface{}) (dec interface{})

func (*Module) Decoder

func (this *Module) Decoder(r io.Reader) *Decoder

func (*Module) Encode

func (this *Module) Encode(dec interface{}) (enc string)

func (*Module) Encoder

func (this *Module) Encoder(w io.Writer) *Encoder

Jump to

Keyboard shortcuts

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