CopyFail should be frontend message
This commit is contained in:
@@ -14,6 +14,7 @@ type Backend struct {
|
||||
// Frontend message flyweights
|
||||
bind Bind
|
||||
_close Close
|
||||
copyFail CopyFail
|
||||
describe Describe
|
||||
execute Execute
|
||||
flush Flush
|
||||
@@ -80,6 +81,8 @@ func (b *Backend) Receive() (FrontendMessage, error) {
|
||||
msg = &b.describe
|
||||
case 'E':
|
||||
msg = &b.execute
|
||||
case 'f':
|
||||
msg = &b.copyFail
|
||||
case 'H':
|
||||
msg = &b.flush
|
||||
case 'P':
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ type CopyFail struct {
|
||||
Message string
|
||||
}
|
||||
|
||||
func (*CopyFail) Backend() {}
|
||||
func (*CopyFail) Frontend() {}
|
||||
|
||||
func (dst *CopyFail) Decode(src []byte) error {
|
||||
idx := bytes.IndexByte(src, 0)
|
||||
|
||||
@@ -22,7 +22,6 @@ type Frontend struct {
|
||||
copyInResponse CopyInResponse
|
||||
copyOutResponse CopyOutResponse
|
||||
copyDone CopyDone
|
||||
copyFail CopyFail
|
||||
dataRow DataRow
|
||||
emptyQueryResponse EmptyQueryResponse
|
||||
errorResponse ErrorResponse
|
||||
@@ -82,8 +81,6 @@ func (b *Frontend) Receive() (BackendMessage, error) {
|
||||
msg = &b.dataRow
|
||||
case 'E':
|
||||
msg = &b.errorResponse
|
||||
case 'f':
|
||||
msg = &b.copyFail
|
||||
case 'G':
|
||||
msg = &b.copyInResponse
|
||||
case 'H':
|
||||
|
||||
Reference in New Issue
Block a user