gosercomp

package module
v0.0.0-...-a96510d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

README

Golang Serialization Benchmark

Serializers

This project test the below go serializers, which compares with go standard json and xml.

Excluded Serializers

Given existed benchmark by alecthomas,the below serializers are excluded from this test because of their poor performance.

Test Environment

go version: 1.11

You'll need to install some tools. On OS X:

brew install thrift flatbuffers
  • For skyencoder, you need to install the tool and get go generate to generate code:

    go get github.com/skycoin/skyencoder/cmd/skyencoder
    go generate
    
  • For MessagePack,you need install the tool and use go generate to generate code:

    go get github.com/tinylib/msgp
    go generate
    
  • For ProtoBuf, you need to install protoc,protobuf lib and generate code:

    go get github.com/golang/protobuf
    go generate
    
  • For gogo/protobuf, use the below commands:

    go get github.com/gogo/protobuf/gogoproto
    go get -u github.com/gogo/protobuf/protoc-gen-gogofaster
    go generate
    
  • For flatbuffers, you need to install [flatbuffers compiler](https://github.com/google/flatbuffers/releases, and flatbuffers lib:

    go get github.com/google/flatbuffers/go
    go generate
    
  • For thrift, you need to install thrift compiler, and thrift lib:

    go get git.apache.org/thrift.git/lib/go/thrift
    go generate
    
  • For Avro, you need to install goavro and checkout v1.0.5

    go get github.com/linkedin/goavro
    cd $GOPATH/src/github.com/linkedin/goavro
    git checkout v1.0.5
    cd -
    go generate
    
  • For gencode, you need to install gencode, and geneate code by gencode:

    go get github.com/andyleap/gencode
    gencode go -schema=gencode.schema -package gosercomp
    
  • For easyjson, you need to install easyjson:

    go get github.com/mailru/easyjson
    go generate
    
  • For zebraPack , you need to install zebraPack, and generate code:

    go get github.com/glycerine/zebrapack
    go generate zebrapack_data.go
    
  • For ugorji/go/codec you need to install codecgen and codec lib:

  go get -tags=unsafe  -u github.com/ugorji/go/codec/codecgen
  go get -tags=unsafe -u github.com/ugorji/go/codec

  codecgen -o data_codec.go data.go
  • For niubaoshu/gotiny you need to checkout v0.0.2:
	go get github.com/niubaoshu/gotiny
	cd $GOPATH/src/github.com/niubaoshu/gotiny
	git checkout v0.0.2

ugorji/go/codec supports msgpack、cbor、binc、json, and this project test its cbor and msgpack.

Actually,you can use go generate to generate code.

Test:

go test -bench=. -benchmem

Test Data Model

All tests are using the same data model as below:

type ColorGroup struct {
    ID     int `json:"id" xml:"id,attr""`
    Name   string `json:"name" xml:"name"`
    Colors []string `json:"colors" xml:"colors"`
}
`

Benchmark

Results generated on Mid-2015 Macbook Pro base model:

goos: darwin
goarch: amd64
pkg: github.com/smallnest/gosercomp
BenchmarkMarshalByJson-8                       	 2000000	       693 ns/op	     128 B/op	       2 allocs/op
BenchmarkUnmarshalByJson-8                     	 1000000	      2168 ns/op	     216 B/op	       8 allocs/op
BenchmarkMarshalByXml-8                        	  500000	      3584 ns/op	    4800 B/op	      11 allocs/op
BenchmarkUnmarshalByXml-8                      	  200000	     12458 ns/op	    3018 B/op	      73 allocs/op
BenchmarkMarshalByMsgp-8                       	20000000	       116 ns/op	      80 B/op	       1 allocs/op
BenchmarkUnmarshalByMsgp-8                     	 5000000	       235 ns/op	      32 B/op	       5 allocs/op
BenchmarkMarshalByProtoBuf-8                   	10000000	       200 ns/op	      48 B/op	       1 allocs/op
BenchmarkUnmarshalByProtoBuf-8                 	 3000000	       494 ns/op	     160 B/op	      10 allocs/op
BenchmarkMarshalByGogoProtoBuf-8               	10000000	       118 ns/op	      48 B/op	       1 allocs/op
BenchmarkUnmarshalByGogoProtoBuf-8             	 3000000	       415 ns/op	     144 B/op	       8 allocs/op
BenchmarkMarshalByFlatBuffers-8                	 5000000	       381 ns/op	      16 B/op	       1 allocs/op
BenchmarkUnmarshalByFlatBuffers-8              	2000000000	         0.35 ns/op	       0 B/op	       0 allocs/op
BenchmarkUnmarshalByFlatBuffers_withFields-8   	10000000	       140 ns/op	       0 B/op	       0 allocs/op
BenchmarkMarshalByThrift-8                     	 3000000	       458 ns/op	      64 B/op	       1 allocs/op
BenchmarkUnmarshalByThrift-8                   	 1000000	      1269 ns/op	     656 B/op	      11 allocs/op
BenchmarkMarshalByAvro-8                       	 3000000	       513 ns/op	      48 B/op	       6 allocs/op
BenchmarkUnmarshalByAvro-8                     	  500000	      3168 ns/op	    1672 B/op	      62 allocs/op
BenchmarkMarshalByGencode-8                    	30000000	        42.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkUnmarshalByGencode-8                  	10000000	       125 ns/op	      32 B/op	       5 allocs/op
BenchmarkMarshalByUgorjiCodecAndCbor-8         	 2000000	       713 ns/op	     112 B/op	       3 allocs/op
BenchmarkUnmarshalByUgorjiCodecAndCbor-8       	 2000000	       618 ns/op	      48 B/op	       6 allocs/op
BenchmarkMarshalByUgorjiCodecAndMsgp-8         	 2000000	       669 ns/op	     112 B/op	       3 allocs/op
BenchmarkUnmarshalByUgorjiCodecAndMsgp-8       	 2000000	       644 ns/op	      48 B/op	       6 allocs/op
BenchmarkMarshalByUgorjiCodecAndBinc-8         	 2000000	       703 ns/op	     112 B/op	       3 allocs/op
BenchmarkUnmarshalByUgorjiCodecAndBinc-8       	 1000000	      1062 ns/op	     824 B/op	      10 allocs/op
BenchmarkMarshalByUgorjiCodecAndJson-8         	 2000000	       847 ns/op	     112 B/op	       3 allocs/op
BenchmarkUnmarshalByUgorjiCodecAndJson-8       	 2000000	       788 ns/op	      48 B/op	       6 allocs/op
BenchmarkMarshalByEasyjson-8                   	 5000000	       302 ns/op	     128 B/op	       1 allocs/op
BenchmarkUnmarshalByEasyjson-8                 	 3000000	       452 ns/op	      32 B/op	       5 allocs/op
BenchmarkMarshalByFfjson-8                     	 1000000	      1031 ns/op	     424 B/op	       9 allocs/op
BenchmarkUnmarshalByFfjson-8                   	 1000000	      1479 ns/op	     480 B/op	      13 allocs/op
BenchmarkMarshalByJsoniter-8                   	 3000000	       529 ns/op	      96 B/op	       2 allocs/op
BenchmarkUnmarshalByJsoniter-8                 	 3000000	       589 ns/op	      32 B/op	       5 allocs/op
BenchmarkUnmarshalByGJSON-8                    	 1000000	      1680 ns/op	     624 B/op	       7 allocs/op
BenchmarkMarshalByGoMemdump-8                  	  300000	      4686 ns/op	    1032 B/op	      30 allocs/op
BenchmarkUnmarshalByGoMemdump-8                	 1000000	      1348 ns/op	    2400 B/op	      12 allocs/op
BenchmarkMarshalBySky-8                        	 2000000	       761 ns/op	     112 B/op	       7 allocs/op
BenchmarkUnmarshalBySky-8                      	 2000000	       701 ns/op	     216 B/op	      11 allocs/op
BenchmarkMarshalBySkyencoder-8                 	20000000	        75.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkMarshalBySkyencoderWithAlloc-8        	20000000	       112 ns/op	      64 B/op	       1 allocs/op
BenchmarkUnmarshalBySkyencoder-8               	10000000	       206 ns/op	      96 B/op	       6 allocs/op
BenchmarkMarshalByColfer-8                     	50000000	        33.7 ns/op	       0 B/op	       0 allocs/op
BenchmarkUnmarshalByColfer-8                   	10000000	       213 ns/op	      96 B/op	       6 allocs/op
BenchmarkMarshalByZebrapack-8                  	10000000	       262 ns/op	     182 B/op	       0 allocs/op
BenchmarkUnmarshalByZebrapack-8                	 5000000	       291 ns/op	      32 B/op	       5 allocs/op
BenchmarkMarshalByGotiny-8                     	20000000	        86.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkUnmarshalByGotiny-8                   	10000000	       176 ns/op	      32 B/op	       5 allocs/op
BenchmarkMarshalByHprose-8                     	 3000000	       455 ns/op	     210 B/op	       1 allocs/op
BenchmarkUnmarshalByHprose-8                   	 2000000	       654 ns/op	     288 B/op	       9 allocs/op
BenchmarkMarshalBySereal-8                     	 1000000	      2202 ns/op	     792 B/op	      22 allocs/op
BenchmarkUnmarshalBySereal-8                   	 2000000	       696 ns/op	      80 B/op	       6 allocs/op
BenchmarkMarshalByMsgpackV2-8                  	 1000000	      2008 ns/op	     192 B/op	       4 allocs/op
BenchmarkUnmarshalByMsgpackv2-8                	 1000000	      1585 ns/op	     232 B/op	      11 allocs/op
BenchmarkMarshalMsgZColorGroup-8               	20000000	        77.3 ns/op	      80 B/op	       1 allocs/op
BenchmarkAppendMsgZColorGroup-8                	30000000	        39.3 ns/op	 356.08 MB/s	       0 B/op	       0 allocs/op
BenchmarkUnmarshalZColorGroup-8                	20000000	        80.6 ns/op	 173.66 MB/s	       0 B/op	       0 allocs/op
BenchmarkEncodeZColorGroup-8                   	20000000	        66.2 ns/op	 211.60 MB/s	      16 B/op	       1 allocs/op
BenchmarkDecodeZColorGroup-8                   	10000000	       129 ns/op	 108.12 MB/s	       0 B/op	       0 allocs/op

Size of marshalled results

    gosercomp_test.go:99: json:				 65 bytes
    gosercomp_test.go:102: xml:				 137 bytes
    gosercomp_test.go:105: msgp:				 47 bytes
    gosercomp_test.go:108: protobuf:				 36 bytes
    gosercomp_test.go:111: gogoprotobuf:			 36 bytes
    gosercomp_test.go:115: flatbuffers:			 108 bytes
    gosercomp_test.go:121: thrift:				 63 bytes
    gosercomp_test.go:135: avro:				 32 bytes
    gosercomp_test.go:144: gencode:				 34 bytes
    gosercomp_test.go:150: UgorjiCodec_Cbor:		 47 bytes
    gosercomp_test.go:156: UgorjiCodec_Msgp:		 47 bytes
    gosercomp_test.go:162: UgorjiCodec_Bin:			 53 bytes
    gosercomp_test.go:164: UgorjiCodec_Json:		 91 bytes
    gosercomp_test.go:167: easyjson:			 65 bytes
    gosercomp_test.go:170: ffjson:				 65 bytes
    gosercomp_test.go:173: jsoniter:			 65 bytes
    gosercomp_test.go:177: memdump:				 200 bytes
    gosercomp_test.go:180: colfer:				 35 bytes
    gosercomp_test.go:183: sky:				 52 bytes
    gosercomp_test.go:186: skyencoder:				 52 bytes
    gosercomp_test.go:189: zebrapack:			 48 bytes
    gosercomp_test.go:193: gotiny:				 32 bytes
    gosercomp_test.go:198: hprose:				 32 bytes
    gosercomp_test.go:202: sereal:				 76 bytes
    gosercomp_test.go:205: msgpackv2:			 47 bytes

Documentation

Overview

Code generated by github.com/skycoin/skyencoder. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ColferSizeMax is the upper limit for serial byte sizes.
	ColferSizeMax = 16 * 1024 * 1024
	// ColferListMax is the upper limit for the number of elements in a list.
	ColferListMax = 64 * 1024
)

Colfer configuration attributes

View Source
var (
	ErrInvalidLengthMygogo = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMygogo   = fmt.Errorf("proto: integer overflow")
)
View Source
var GoUnusedProtection__ int

Functions

func DecodeSkyGroup

func DecodeSkyGroup(buf []byte, obj *SkyGroup) (int, error)

DecodeSkyGroup decodes an object of type SkyGroup from the buffer in encoder.Decoder. Returns the number of bytes used from the buffer to decode the object.

func EncodeSizeSkyGroup

func EncodeSizeSkyGroup(obj *SkyGroup) int

EncodeSizeSkyGroup computes the size of an encoded object of type SkyGroup

func EncodeSkyGroup

func EncodeSkyGroup(buf []byte, obj *SkyGroup) error

EncodeSkyGroup encodes an object of type SkyGroup to the buffer in encoder.Encoder. The buffer must be large enough to encode the object, otherwise an error is returned.

func FlatBufferColorGroupAddCgId

func FlatBufferColorGroupAddCgId(builder *flatbuffers.Builder, cgId int32)

func FlatBufferColorGroupAddColors

func FlatBufferColorGroupAddColors(builder *flatbuffers.Builder, colors flatbuffers.UOffsetT)

func FlatBufferColorGroupAddName

func FlatBufferColorGroupAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT)

func FlatBufferColorGroupEnd

func FlatBufferColorGroupEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func FlatBufferColorGroupStart

func FlatBufferColorGroupStart(builder *flatbuffers.Builder)

func FlatBufferColorGroupStartColorsVector

func FlatBufferColorGroupStartColorsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

Types

type ColferColorGroup

type ColferColorGroup struct {
	Id     int32
	Name   string
	Colors []string
}

func (*ColferColorGroup) MarshalBinary

func (o *ColferColorGroup) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is gosercomp.ColferMax.

func (*ColferColorGroup) MarshalLen

func (o *ColferColorGroup) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is gosercomp.ColferMax.

func (*ColferColorGroup) MarshalTo

func (o *ColferColorGroup) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*ColferColorGroup) Unmarshal

func (o *ColferColorGroup) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, gosercomp.ColferError and gosercomp.ColferMax.

func (*ColferColorGroup) UnmarshalBinary

func (o *ColferColorGroup) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, gosercomp.ColferError, gosercomp.ColferTail and gosercomp.ColferMax.

type ColferError

type ColferError int

ColferError signals a data mismatch as as a byte index.

func (ColferError) Error

func (i ColferError) Error() string

Error honors the error interface.

type ColferMax

type ColferMax string

ColferMax signals an upper limit breach.

func (ColferMax) Error

func (m ColferMax) Error() string

Error honors the error interface.

type ColferTail

type ColferTail int

ColferTail signals data continuation as a byte index.

func (ColferTail) Error

func (i ColferTail) Error() string

Error honors the error interface.

type ColorGroup

type ColorGroup struct {
	Id     int      `json:"id" xml:"id,attr" msg:"id"`
	Name   string   `json:"name" xml:"name" msg:"name"`
	Colors []string `json:"colors" xml:"colors" msg:"colors"`
}

func (*ColorGroup) CodecDecodeSelf

func (x *ColorGroup) CodecDecodeSelf(d *codec1978.Decoder)

func (*ColorGroup) CodecEncodeSelf

func (x *ColorGroup) CodecEncodeSelf(e *codec1978.Encoder)

func (*ColorGroup) MarshalBson

func (colorGroup *ColorGroup) MarshalBson(buf *bson.ChunkedWriter, key string)

MarshalBson bson-encodes ColorGroup.

func (*ColorGroup) MarshalMsg

func (z *ColorGroup) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ColorGroup) Msgsize

func (z *ColorGroup) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ColorGroup) UnmarshalBson

func (colorGroup *ColorGroup) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into ColorGroup.

func (*ColorGroup) UnmarshalMsg

func (z *ColorGroup) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EColorGroup

type EColorGroup struct {
	Id     int      `json:"id" xml:"id,attr" msg:"id"`
	Name   string   `json:"name" xml:"name" msg:"name"`
	Colors []string `json:"colors" xml:"colors" msg:"colors"`
}

func (EColorGroup) MarshalEasyJSON

func (v EColorGroup) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EColorGroup) MarshalJSON

func (v EColorGroup) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EColorGroup) UnmarshalEasyJSON

func (v *EColorGroup) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EColorGroup) UnmarshalJSON

func (v *EColorGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type FColorGroup

type FColorGroup struct {
	Id     int      `json:"id" xml:"id,attr" msg:"id"`
	Name   string   `json:"name" xml:"name" msg:"name"`
	Colors []string `json:"colors" xml:"colors" msg:"colors"`
}

func (*FColorGroup) MarshalJSON

func (j *FColorGroup) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*FColorGroup) MarshalJSONBuf

func (j *FColorGroup) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

func (*FColorGroup) UnmarshalJSON

func (j *FColorGroup) UnmarshalJSON(input []byte) error

UnmarshalJSON umarshall json - template of ffjson

func (*FColorGroup) UnmarshalJSONFFLexer

func (j *FColorGroup) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

UnmarshalJSONFFLexer fast json unmarshall - template ffjson

type FileZebrapack_data

type FileZebrapack_data struct{}

FileZebrapack_data holds ZebraPack schema from file 'zebrapack_data.go'

func (FileZebrapack_data) ZebraSchemaInJsonCompact

func (FileZebrapack_data) ZebraSchemaInJsonCompact() []byte

ZebraSchemaInJsonCompact provides the ZebraPack Schema in compact JSON format, length 613 bytes

func (FileZebrapack_data) ZebraSchemaInJsonPretty

func (FileZebrapack_data) ZebraSchemaInJsonPretty() []byte

ZebraSchemaInJsonPretty provides the ZebraPack Schema in pretty JSON format, length 1569 bytes

func (FileZebrapack_data) ZebraSchemaInMsgpack2Format

func (FileZebrapack_data) ZebraSchemaInMsgpack2Format() []byte

ZebraSchemaInMsgpack2Format provides the ZebraPack Schema in msgpack2 format, length 483 bytes

type FlatBufferColorGroup

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

func GetRootAsFlatBufferColorGroup

func GetRootAsFlatBufferColorGroup(buf []byte, offset flatbuffers.UOffsetT) *FlatBufferColorGroup

func (*FlatBufferColorGroup) CgId

func (rcv *FlatBufferColorGroup) CgId() int32

func (*FlatBufferColorGroup) Colors

func (rcv *FlatBufferColorGroup) Colors(j int) []byte

func (*FlatBufferColorGroup) ColorsLength

func (rcv *FlatBufferColorGroup) ColorsLength() int

func (*FlatBufferColorGroup) Init

func (rcv *FlatBufferColorGroup) Init(buf []byte, i flatbuffers.UOffsetT)

func (*FlatBufferColorGroup) MutateCgId

func (rcv *FlatBufferColorGroup) MutateCgId(n int32) bool

func (*FlatBufferColorGroup) Name

func (rcv *FlatBufferColorGroup) Name() []byte

func (*FlatBufferColorGroup) Table

func (rcv *FlatBufferColorGroup) Table() flatbuffers.Table

type GencodeColorGroup

type GencodeColorGroup struct {
	Id     int32
	Name   string
	Colors []string
}

func (*GencodeColorGroup) Marshal

func (d *GencodeColorGroup) Marshal(buf []byte) ([]byte, error)

func (*GencodeColorGroup) Size

func (d *GencodeColorGroup) Size() (s uint64)

func (*GencodeColorGroup) Unmarshal

func (d *GencodeColorGroup) Unmarshal(buf []byte) (uint64, error)

type GogoProtoColorGroup

type GogoProtoColorGroup struct {
	Id     int32    `protobuf:"varint,1,req,name=id" json:"id"`
	Name   string   `protobuf:"bytes,2,req,name=name" json:"name"`
	Colors []string `protobuf:"bytes,3,rep,name=colors" json:"colors,omitempty"`
}

func (*GogoProtoColorGroup) Descriptor

func (*GogoProtoColorGroup) Descriptor() ([]byte, []int)

func (*GogoProtoColorGroup) GetColors

func (m *GogoProtoColorGroup) GetColors() []string

func (*GogoProtoColorGroup) GetId

func (m *GogoProtoColorGroup) GetId() int32

func (*GogoProtoColorGroup) GetName

func (m *GogoProtoColorGroup) GetName() string

func (*GogoProtoColorGroup) Marshal

func (m *GogoProtoColorGroup) Marshal() (dAtA []byte, err error)

func (*GogoProtoColorGroup) MarshalTo

func (m *GogoProtoColorGroup) MarshalTo(dAtA []byte) (int, error)

func (*GogoProtoColorGroup) ProtoMessage

func (*GogoProtoColorGroup) ProtoMessage()

func (*GogoProtoColorGroup) Reset

func (m *GogoProtoColorGroup) Reset()

func (*GogoProtoColorGroup) Size

func (m *GogoProtoColorGroup) Size() (n int)

func (*GogoProtoColorGroup) String

func (m *GogoProtoColorGroup) String() string

func (*GogoProtoColorGroup) Unmarshal

func (m *GogoProtoColorGroup) Unmarshal(dAtA []byte) error

func (*GogoProtoColorGroup) XXX_DiscardUnknown

func (m *GogoProtoColorGroup) XXX_DiscardUnknown()

func (*GogoProtoColorGroup) XXX_Marshal

func (m *GogoProtoColorGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GogoProtoColorGroup) XXX_Merge

func (dst *GogoProtoColorGroup) XXX_Merge(src proto.Message)

func (*GogoProtoColorGroup) XXX_Size

func (m *GogoProtoColorGroup) XXX_Size() int

func (*GogoProtoColorGroup) XXX_Unmarshal

func (m *GogoProtoColorGroup) XXX_Unmarshal(b []byte) error

type ProtoColorGroup

type ProtoColorGroup struct {
	Id                   *int32   `protobuf:"varint,1,req,name=id" json:"id,omitempty"`
	Name                 *string  `protobuf:"bytes,2,req,name=name" json:"name,omitempty"`
	Colors               []string `protobuf:"bytes,3,rep,name=colors" json:"colors,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ProtoColorGroup) Descriptor

func (*ProtoColorGroup) Descriptor() ([]byte, []int)

func (*ProtoColorGroup) GetColors

func (m *ProtoColorGroup) GetColors() []string

func (*ProtoColorGroup) GetId

func (m *ProtoColorGroup) GetId() int32

func (*ProtoColorGroup) GetName

func (m *ProtoColorGroup) GetName() string

func (*ProtoColorGroup) ProtoMessage

func (*ProtoColorGroup) ProtoMessage()

func (*ProtoColorGroup) Reset

func (m *ProtoColorGroup) Reset()

func (*ProtoColorGroup) String

func (m *ProtoColorGroup) String() string

func (*ProtoColorGroup) XXX_DiscardUnknown

func (m *ProtoColorGroup) XXX_DiscardUnknown()

func (*ProtoColorGroup) XXX_Marshal

func (m *ProtoColorGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProtoColorGroup) XXX_Merge

func (dst *ProtoColorGroup) XXX_Merge(src proto.Message)

func (*ProtoColorGroup) XXX_Size

func (m *ProtoColorGroup) XXX_Size() int

func (*ProtoColorGroup) XXX_Unmarshal

func (m *ProtoColorGroup) XXX_Unmarshal(b []byte) error

type SkyGroup

type SkyGroup struct {
	Id     int32
	Name   string
	Colors []string
}

type ThriftColorGroup

type ThriftColorGroup struct {
	ID     int32    `thrift:"id,1" db:"id" json:"id"`
	Name   string   `thrift:"name,2" db:"name" json:"name"`
	Colors []string `thrift:"colors,3" db:"colors" json:"colors"`
}

Attributes:

  • ID
  • Name
  • Colors

func NewThriftColorGroup

func NewThriftColorGroup() *ThriftColorGroup

func (*ThriftColorGroup) GetColors

func (p *ThriftColorGroup) GetColors() []string

func (*ThriftColorGroup) GetID

func (p *ThriftColorGroup) GetID() int32

func (*ThriftColorGroup) GetName

func (p *ThriftColorGroup) GetName() string

func (*ThriftColorGroup) Read

func (p *ThriftColorGroup) Read(iprot thrift.TProtocol) error

func (*ThriftColorGroup) ReadField1

func (p *ThriftColorGroup) ReadField1(iprot thrift.TProtocol) error

func (*ThriftColorGroup) ReadField2

func (p *ThriftColorGroup) ReadField2(iprot thrift.TProtocol) error

func (*ThriftColorGroup) ReadField3

func (p *ThriftColorGroup) ReadField3(iprot thrift.TProtocol) error

func (*ThriftColorGroup) String

func (p *ThriftColorGroup) String() string

func (*ThriftColorGroup) Write

func (p *ThriftColorGroup) Write(oprot thrift.TProtocol) error

type ZColorGroup

type ZColorGroup struct {
	Id     int      `json:"id" xml:"id,attr" msg:"id" zid:"0"`
	Name   string   `json:"name" xml:"name" msg:"name" zid:"1"`
	Colors []string `json:"colors" xml:"colors" msg:"colors" zid:"2"`
}

func (*ZColorGroup) DecodeMsg

func (z *ZColorGroup) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable We treat empty fields as if we read a Nil from the wire.

func (*ZColorGroup) EncodeMsg

func (z *ZColorGroup) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ZColorGroup) MarshalMsg

func (z *ZColorGroup) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ZColorGroup) Msgsize

func (z *ZColorGroup) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ZColorGroup) UnmarshalMsg

func (z *ZColorGroup) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ZColorGroup) UnmarshalMsgWithCfg

func (z *ZColorGroup) UnmarshalMsgWithCfg(bts []byte, cfg *msgp.RuntimeConfig) (o []byte, err error)

Jump to

Keyboard shortcuts

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