4e2900b774
pgproto3 will wrap the message encoding and decoding for the PostgreSQL frontend/backend protocol version 3.
30 lines
583 B
Go
30 lines
583 B
Go
package pgproto3
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type EmptyQueryResponse struct{}
|
|
|
|
func (*EmptyQueryResponse) Backend() {}
|
|
|
|
func (dst *EmptyQueryResponse) UnmarshalBinary(src []byte) error {
|
|
if len(src) != 0 {
|
|
return &invalidMessageLenErr{messageType: "EmptyQueryResponse", expectedLen: 0, actualLen: len(src)}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (src *EmptyQueryResponse) MarshalBinary() ([]byte, error) {
|
|
return []byte{'I', 0, 0, 0, 4}, nil
|
|
}
|
|
|
|
func (src *EmptyQueryResponse) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(struct {
|
|
Type string
|
|
}{
|
|
Type: "EmptyQueryResponse",
|
|
})
|
|
}
|