mirror of https://github.com/jackc/pgx.git
parent
a340d5f15f
commit
18e7e777be
|
@ -34,6 +34,7 @@ type Frontend struct {
|
|||
parseComplete ParseComplete
|
||||
readyForQuery ReadyForQuery
|
||||
rowDescription RowDescription
|
||||
portalSuspended PortalSuspended
|
||||
|
||||
bodyLen int
|
||||
msgType byte
|
||||
|
@ -95,6 +96,8 @@ func (b *Frontend) Receive() (BackendMessage, error) {
|
|||
msg = &b.noticeResponse
|
||||
case 'R':
|
||||
msg = &b.authentication
|
||||
case 's':
|
||||
msg = &b.portalSuspended
|
||||
case 'S':
|
||||
msg = &b.parameterStatus
|
||||
case 't':
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package pgproto3
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type PortalSuspended struct{}
|
||||
|
||||
func (*PortalSuspended) Backend() {}
|
||||
|
||||
func (dst *PortalSuspended) Decode(src []byte) error {
|
||||
if len(src) != 0 {
|
||||
return &invalidMessageLenErr{messageType: "PortalSuspended", expectedLen: 0, actualLen: len(src)}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (src *PortalSuspended) Encode(dst []byte) []byte {
|
||||
return append(dst, 's', 0, 0, 0, 4)
|
||||
}
|
||||
|
||||
func (src *PortalSuspended) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(struct {
|
||||
Type string
|
||||
}{
|
||||
Type: "PortalSuspended",
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue