Skip to content

Commit

Permalink
update version to 1.2.0 (#7)
Browse files Browse the repository at this point in the history
* update version to 1.2.0
add change log and todo list
  • Loading branch information
vipally committed Nov 2, 2017
1 parent bc7e3c1 commit aaffe64
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# binary

[![Build Status](https://travis-ci.org/vipally/binary.svg?branch=master)](https://travis-ci.org/vipally/binary) [![Coverage Status](https://coveralls.io/repos/github/vipally/binary/badge.svg?branch=master)](https://coveralls.io/github/vipally/binary?branch=master) [![GoDoc](https://godoc.org/github.com/vipally/binary?status.svg)](https://godoc.org/github.com/vipally/binary) ![Version](https://img.shields.io/badge/version-1.1.0-green.svg)
[![Build Status](https://travis-ci.org/vipally/binary.svg?branch=master)](https://travis-ci.org/vipally/binary) [![Coverage Status](https://coveralls.io/repos/github/vipally/binary/badge.svg?branch=master)](https://coveralls.io/github/vipally/binary?branch=master) [![GoDoc](https://godoc.org/github.com/vipally/binary?status.svg)](https://godoc.org/github.com/vipally/binary) ![Version](https://img.shields.io/badge/version-1.2.0-green.svg)

***

Expand All @@ -26,6 +26,30 @@ Blog : [http://blog.csdn.net/vipally](http://blog.csdn.net/vipally)
Site : [https://github.com/vipally](https://github.com/vipally)

****
# change log:
## v1.2.0
1.use field tag `binary:"packed"` to encode ints value as varint/uvarint
for reged structs.
2.add method Encoder.ResizeBuffer.
## v1.1.0
1.fix issue#1 nil pointer encode/decode error.
2.pack 8 bool values as bits in one byte.
3.put one bool bit for pointer fields to check if it is a nil pointer.
4.rename Pack/Unpack to Encode/Decode.
## v1.0.0
1.full-type support like gob.
2.light-weight as std.binary.
3.high-performance as std.binary and gob.
4.encoding with fower bytes than std.binary and gob.
5.use RegStruct to improve performance of struct encoding/decoding.
6.take both advantages of std.binary and gob.
7.recommended using in net protocol serialization and DB serialization.

# TODO:
1.[Encoder/Decoder].RegStruct to speed up local Coder.
2.[Encoder/Decoder].RegSerializer to speed up BinarySerializer search.
3.reg interface to using BinarySerializer interface.
****

# 1. Support all serialize-able basic types:
int, int8, int16, int32, int64,
Expand Down
15 changes: 2 additions & 13 deletions export.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
// Origin : https://github.com/vipally/binary
package binary

// **************************************************************************
// TODO:
// 1.[Encoder/Decoder].RegStruct
// 2.[Encoder/Decoder].RegMarshaler
// 3.[Encoder/Decoder].ResizeBuffer
// 4.bool as a bit
// 5.pointer put a bool to check if it is nil
// 6.reg interface to using PackUnpacker interface
// 7.use `binary:"packed"` to set if store a int_n value as varint
// ***************************************************************************

import (
"errors"
"io"
Expand Down Expand Up @@ -161,7 +150,7 @@ type BinarySizer interface {
}

// BinaryEncoder is an interface to define go data Encode method.
// buffer is nil-able
// buffer is nil-able.
type BinaryEncoder interface {
Encode(buffer []byte) ([]byte, error)
}
Expand Down Expand Up @@ -201,7 +190,7 @@ func Decode(buffer []byte, data interface{}) error {
return decoder.Value(data)
}

// MakeEncodeBuffer create enough buffer to encode data
// MakeEncodeBuffer create enough buffer to encode data.
// nil buffer is aviable, it will create new buffer if necessary.
func MakeEncodeBuffer(data interface{}, buffer []byte) ([]byte, error) {
size := Sizeof(data)
Expand Down

0 comments on commit aaffe64

Please sign in to comment.