8000 GitHub - gonuts/cbor: cbor provides CBOR encoding/decoding for Go
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

gonuts/cbor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cbor

GoDoc

cbor is a thin wrapper around cbor and exposes a familiar Encoder/Decoder API (a la json.)

Installation

$ go get github.com/gonuts/cbor

Documentation

Documentation is available on godoc: https://godoc.org/github.com/gonuts/cbor

Example

package main

import (
	"bytes"
	"fmt"

	"github.com/gonuts/cbor"
)

func main() {
	buf := new(bytes.Buffer)
	enc := cbor.NewEncoder(buf)
	err := enc.Encode(42)
	if err != nil {
		panic(err)
	}

	val := 0
	dec := cbor.NewDecoder(buf)
	err = dec.Decode(&val)
	if err != nil {
		panic(err)
	}

	fmt.Printf("val=%#v\n", val)
}

About

cbor provides CBOR encoding/decoding for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0