open-vault/vendor/github.com/jackc/pgx/pgproto3/copy_done.go
2018-10-03 09:55:26 -07:00

31 lines
500 B
Go

package pgproto3
import (
"encoding/json"
)
type CopyDone struct {
}
func (*CopyDone) Backend() {}
func (dst *CopyDone) Decode(src []byte) error {
if len(src) != 0 {
return &invalidMessageLenErr{messageType: "CopyDone", expectedLen: 0, actualLen: len(src)}
}
return nil
}
func (src *CopyDone) Encode(dst []byte) []byte {
return append(dst, 'c', 0, 0, 0, 4)
}
func (src *CopyDone) MarshalJSON() ([]byte, error) {
return json.Marshal(struct {
Type string
}{
Type: "CopyDone",
})
}