package proto
import (
protoV2
)
var (
ErrNil = errors.New("proto: Marshal called with nil")
ErrTooLarge = errors.New("proto: message encodes to over 2 GB")
ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
)
type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
func () Stats { return Stats{} }
func (interface{}) ([]byte, error) {
return nil, errors.New("proto: not implemented")
}
func ([]byte, interface{}) error {
return errors.New("proto: not implemented")
}
func (interface{}) ([]byte, error) {
return nil, errors.New("proto: not implemented")
}
func ([]byte, interface{}) error {
return errors.New("proto: not implemented")
}
func (Message, int32, string) {}
func ( map[int32]string, int32) string {
, := []
if {
return
}
return strconv.Itoa(int())
}
func ( map[string]int32, []byte, string) (int32, error) {
if [0] == '"' {
var string
if := json.Unmarshal(, &); != nil {
return -1,
}
, := []
if ! {
return 0, fmt.Errorf("unrecognized enum %s value %q", , )
}
return , nil
}
var int32
if := json.Unmarshal(, &); != nil {
return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", , )
}
return , nil
}
type InternalMessageInfo struct{}
func (*InternalMessageInfo) ( Message) {
DiscardUnknown()
}
func (*InternalMessageInfo) ( []byte, Message, bool) ([]byte, error) {
return protoV2.MarshalOptions{Deterministic: }.MarshalAppend(, MessageV2())
}
func (*InternalMessageInfo) (, Message) {
protoV2.Merge(MessageV2(), MessageV2())
}
func (*InternalMessageInfo) ( Message) int {
return protoV2.Size(MessageV2())
}
func (*InternalMessageInfo) ( Message, []byte) error {
return protoV2.UnmarshalOptions{Merge: true}.Unmarshal(, MessageV2())
}