增加websocket支持
This commit is contained in:
		
							
								
								
									
										15
									
								
								vendor/github.com/jackc/pgx/v5/pgproto3/parse.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								vendor/github.com/jackc/pgx/v5/pgproto3/parse.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4,8 +4,6 @@ import ( | ||||
| 	"bytes" | ||||
| 	"encoding/binary" | ||||
| 	"encoding/json" | ||||
| 	"errors" | ||||
| 	"math" | ||||
|  | ||||
| 	"github.com/jackc/pgx/v5/internal/pgio" | ||||
| ) | ||||
| @@ -54,23 +52,24 @@ func (dst *Parse) Decode(src []byte) error { | ||||
| } | ||||
|  | ||||
| // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. | ||||
| func (src *Parse) Encode(dst []byte) ([]byte, error) { | ||||
| 	dst, sp := beginMessage(dst, 'P') | ||||
| func (src *Parse) Encode(dst []byte) []byte { | ||||
| 	dst = append(dst, 'P') | ||||
| 	sp := len(dst) | ||||
| 	dst = pgio.AppendInt32(dst, -1) | ||||
|  | ||||
| 	dst = append(dst, src.Name...) | ||||
| 	dst = append(dst, 0) | ||||
| 	dst = append(dst, src.Query...) | ||||
| 	dst = append(dst, 0) | ||||
|  | ||||
| 	if len(src.ParameterOIDs) > math.MaxUint16 { | ||||
| 		return nil, errors.New("too many parameter oids") | ||||
| 	} | ||||
| 	dst = pgio.AppendUint16(dst, uint16(len(src.ParameterOIDs))) | ||||
| 	for _, oid := range src.ParameterOIDs { | ||||
| 		dst = pgio.AppendUint32(dst, oid) | ||||
| 	} | ||||
|  | ||||
| 	return finishMessage(dst, sp) | ||||
| 	pgio.SetInt32(dst[sp:], int32(len(dst[sp:]))) | ||||
|  | ||||
| 	return dst | ||||
| } | ||||
|  | ||||
| // MarshalJSON implements encoding/json.Marshaler. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user