package pgproto3
import (
)
type ParameterStatus struct {
Name string
Value string
}
func (*ParameterStatus) () {}
func ( *ParameterStatus) ( []byte) error {
:= bytes.NewBuffer()
, := .ReadBytes(0)
if != nil {
return
}
:= string([:len()-1])
, = .ReadBytes(0)
if != nil {
return
}
:= string([:len()-1])
* = ParameterStatus{Name: , Value: }
return nil
}
func ( *ParameterStatus) ( []byte) ([]byte, error) {
, := beginMessage(, 'S')
= append(, .Name...)
= append(, 0)
= append(, .Value...)
= append(, 0)
return finishMessage(, )
}
func ( ParameterStatus) () ([]byte, error) {
return json.Marshal(struct {
string
string
string
}{
: "ParameterStatus",
: .Name,
: .Value,
})
}