Source File
function_call_response.go
Belonging Package
github.com/jackc/pgproto3/v2
package pgproto3
import (
)
type FunctionCallResponse struct {
Result []byte
}
func (*FunctionCallResponse) () {}
func ( *FunctionCallResponse) ( []byte) error {
if len() < 4 {
return &invalidMessageFormatErr{messageType: "FunctionCallResponse"}
}
:= 0
:= int(binary.BigEndian.Uint32([:]))
+= 4
if == -1 {
.Result = nil
return nil
}
if len([:]) != {
return &invalidMessageFormatErr{messageType: "FunctionCallResponse"}
}
.Result = [:]
return nil
}
func ( FunctionCallResponse) () ([]byte, error) {
var map[string]string
var bool
for , := range .Result {
if < 32 {
= true
break
}
}
if {
= map[string]string{"binary": hex.EncodeToString(.Result)}
} else {
= map[string]string{"text": string(.Result)}
}
return json.Marshal(struct {
string
map[string]string
}{
: "FunctionCallResponse",
: ,
})
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin 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. |