Use index singleton and relocate encoder package.

This commit is contained in:
Matt T. Proud 2012-11-25 16:07:05 +01:00
parent b9928266b5
commit 720442d3d3
8 changed files with 51 additions and 62 deletions

19
coding/protocol_buffer.go Normal file
View file

@ -0,0 +1,19 @@
package coding
import (
"code.google.com/p/goprotobuf/proto"
)
type ProtocolBufferEncoder struct {
message proto.Message
}
func (p *ProtocolBufferEncoder) Encode() ([]byte, error) {
return proto.Marshal(p.message)
}
func NewProtocolBufferEncoder(message proto.Message) *ProtocolBufferEncoder {
return &ProtocolBufferEncoder{
message: message,
}
}