Skip to content

Commit 3f3720f

Browse files
committed
refactor: add flow tag in yaml tag
Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>
1 parent bcab25f commit 3f3720f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

bind.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
type Bind struct {
1414
DestinationPortal string `json:"destination_portal,omitempty" yaml:"destination_portal,omitempty"`
1515
PreparedStatement string `json:"prepared_statement,omitempty" yaml:"prepared_statement,omitempty"`
16-
ParameterFormatCodes []int16 `json:"parameter_format_codes,omitempty" yaml:"parameter_format_codes,omitempty"`
17-
Parameters [][]byte `json:"parameters,omitempty" yaml:"parameters,omitempty"`
18-
ResultFormatCodes []int16 `json:"result_format_codes,omitempty" yaml:"result_format_codes,omitempty"`
16+
ParameterFormatCodes []int16 `json:"parameter_format_codes,omitempty" yaml:"parameter_format_codes,omitempty,flow"`
17+
Parameters [][]byte `json:"parameters,omitempty" yaml:"parameters,omitempty,flow"`
18+
ResultFormatCodes []int16 `json:"result_format_codes,omitempty" yaml:"result_format_codes,omitempty,flow"`
1919
}
2020

2121
// Frontend identifies this message as sendable by a PostgreSQL frontend.
@@ -39,6 +39,7 @@ func (dst *Bind) Decode(src []byte) error {
3939
return &invalidMessageFormatErr{messageType: "Bind"}
4040
}
4141
dst.PreparedStatement = string(src[rp : rp+idx])
42+
// fmt.Printf("PreparedStatement: %s\n", dst.PreparedStatement)
4243
rp += idx + 1
4344

4445
if len(src[rp:]) < 2 {
@@ -104,7 +105,7 @@ func (dst *Bind) Decode(src []byte) error {
104105
dst.ResultFormatCodes[i] = int16(binary.BigEndian.Uint16(src[rp:]))
105106
rp += 2
106107
}
107-
dst.MarshalJSON()
108+
108109

109110
return nil
110111
}

ssl_request.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
const sslRequestNumber = 80877103
1212

1313
type SSLRequest struct {
14+
// if it doesn't work add here any struct
15+
IsSSL bool `json:"is_ssl" yaml:"is_ssl"`
1416
}
1517

1618
// Frontend identifies this message as sendable by a PostgreSQL frontend.
@@ -20,13 +22,13 @@ func (dst *SSLRequest) Decode(src []byte) error {
2022
if len(src) < 4 {
2123
return errors.New("ssl request too short")
2224
}
23-
25+
2426
requestCode := binary.BigEndian.Uint32(src)
25-
27+
dst.IsSSL = true
2628
if requestCode != sslRequestNumber {
2729
return errors.New("bad ssl request code")
2830
}
29-
31+
3032
return nil
3133
}
3234

0 commit comments

Comments
 (0)