msgpack

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: MIT Imports: 3 Imported by: 36

README

MessagePack for Golang

Build Status

Usage

Installation
go get -u github.com/shamaton/msgpack
How to use
use simply
package main;

import (
  "github.com/shamaton/msgpack"
)

func main() {
	type Struct struct {
		String string
	}
	v := Struct{String: "msgpack"}

	d, err := msgpack.Encode(v)
	if err != nil {
		panic(err)
	}
	r := Struct{}
	err = msgpack.Decode(&r, d)
	if err != nil {
		panic(err)
	}
}

License

This library is under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StructAsArray = false

Functions

func AddExtCoder

func AddExtCoder(e ext.Encoder, d ext.Decoder)

func Decode

func Decode(data []byte, v interface{}) error

func DecodeStructAsArray

func DecodeStructAsArray(data []byte, v interface{}) error

func DecodeStructAsMap

func DecodeStructAsMap(data []byte, v interface{}) error

func Encode

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

func EncodeStructAsArray

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

func EncodeStructAsMap

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

func RemoveExtCoder

func RemoveExtCoder(e ext.Encoder, d ext.Decoder)

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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