1package pgproto3
2
3import (
4	"encoding/json"
5)
6
7type Flush struct{}
8
9func (*Flush) Frontend() {}
10
11func (dst *Flush) Decode(src []byte) error {
12	if len(src) != 0 {
13		return &invalidMessageLenErr{messageType: "Flush", expectedLen: 0, actualLen: len(src)}
14	}
15
16	return nil
17}
18
19func (src *Flush) Encode(dst []byte) []byte {
20	return append(dst, 'H', 0, 0, 0, 4)
21}
22
23func (src *Flush) MarshalJSON() ([]byte, error) {
24	return json.Marshal(struct {
25		Type string
26	}{
27		Type: "Flush",
28	})
29}
30