mirror of
https://github.com/wader/fq.git
synced 2024-11-26 21:55:57 +03:00
postgres: refactoring
This commit is contained in:
parent
9508a209ea
commit
f6f8d5c037
@ -343,7 +343,7 @@ type TLS_In struct {
|
|||||||
Keylog string `doc:"NSS Key Log content"`
|
Keylog string `doc:"NSS Key Log content"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PostgresIn struct {
|
type PgControlIn struct {
|
||||||
Flavour string `doc:"PostgreSQL flavour: postgres14, pgproee14.., postgres10"`
|
Flavour string `doc:"PostgreSQL flavour: postgres14, pgproee14.., postgres10"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ func init() {
|
|||||||
interp.RegisterFormat(format.PG_CONTROL, &decode.Format{
|
interp.RegisterFormat(format.PG_CONTROL, &decode.Format{
|
||||||
Description: "PostgreSQL control file",
|
Description: "PostgreSQL control file",
|
||||||
DecodeFn: decodePgControl,
|
DecodeFn: decodePgControl,
|
||||||
DefaultInArg: format.PostgresIn{
|
DefaultInArg: format.PgControlIn{
|
||||||
Flavour: "",
|
Flavour: "",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -72,9 +72,9 @@ const (
|
|||||||
func decodePgControl(d *decode.D) any {
|
func decodePgControl(d *decode.D) any {
|
||||||
d.Endian = decode.LittleEndian
|
d.Endian = decode.LittleEndian
|
||||||
|
|
||||||
var pgIn format.PostgresIn
|
var pgIn format.PgControlIn
|
||||||
if !d.ArgAs(&pgIn) {
|
if !d.ArgAs(&pgIn) {
|
||||||
d.Fatalf("DecodeInArg must be PostgresIn!\n")
|
d.Fatalf("DecodeInArg must be PgControlIn!\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
switch pgIn.Flavour {
|
switch pgIn.Flavour {
|
||||||
|
@ -37,7 +37,7 @@ func decodePgheap(d *decode.D) any {
|
|||||||
|
|
||||||
var pgIn format.PostgresHeapIn
|
var pgIn format.PostgresHeapIn
|
||||||
if !d.ArgAs(&pgIn) {
|
if !d.ArgAs(&pgIn) {
|
||||||
d.Fatalf("DecodeInArg must be PostgresIn!\n")
|
d.Fatalf("DecodeInArg must be PostgresHeapIn!\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
switch pgIn.Flavour {
|
switch pgIn.Flavour {
|
||||||
|
Loading…
Reference in New Issue
Block a user