package pgproto3import ()typeReadyForQuerystruct { TxStatus byte}// Backend identifies this message as sendable by the PostgreSQL backend.func (*ReadyForQuery) () {}// Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message// type identifier and 4 byte message length.func ( *ReadyForQuery) ( []byte) error {iflen() != 1 {return &invalidMessageLenErr{messageType: "ReadyForQuery", expectedLen: 1, actualLen: len()} } .TxStatus = [0]returnnil}// Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.func ( *ReadyForQuery) ( []byte) []byte {returnappend(, 'Z', 0, 0, 0, 5, .TxStatus)}// MarshalJSON implements encoding/json.Marshaler.func ( ReadyForQuery) () ([]byte, error) {returnjson.Marshal(struct {stringstring }{ : "ReadyForQuery", : string(.TxStatus), })}// UnmarshalJSON implements encoding/json.Unmarshaler.func ( *ReadyForQuery) ( []byte) error {// Ignore null, like in the main JSON package.ifstring() == "null" {returnnil }varstruct {string }if := json.Unmarshal(, &); != nil {return }iflen(.) != 1 {returnerrors.New("invalid length for ReadyForQuery.TxStatus") } .TxStatus = .[0]returnnil}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.