generated from koddr/template-go
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.go
75 lines (65 loc) · 2.14 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
// App represents struct for the application instance.
type App struct {
Config *Config
Inputs *Inputs
Filtered *Filtered
Outputs *Outputs
}
// Config represents struct for the configuration instance.
type Config struct {
SaveFilteredPKToCSV bool `koanf:"save_filtered_pk_to_csv"`
ColumnsOrder []string `koanf:"columns_order"`
CSVColumnSeparator string `koanf:"csv_column_separator"`
API *API `koanf:"api"`
FilterColumns []*Column `koanf:"filter_columns"`
UpdateFields []*Field `koanf:"update_fields"`
}
// API represents struct for the api instance.
type API struct {
RequestTimeout int `koanf:"request_timeout"`
BaseURL string `koanf:"base_url"`
BaseURLSchema string `koanf:"base_url_schema"`
AuthMethod string `koanf:"auth_method"`
Token string `koanf:"token"`
UpdateEndpoint *Endpoint `koanf:"update_endpoint"`
}
// Column represents struct for the one column instance..
type Column struct {
ColumnName string `koanf:"column_name"`
Condition string `koanf:"condition"`
Value string `koanf:"value"`
}
// Field represents struct for the one field instance.
type Field struct {
FieldName string `koanf:"field_name"`
Values []string `koanf:"values"`
Conditions []*Column `koanf:"conditions"`
}
// Endpoint represents struct for the one endpoint instance.
type Endpoint struct {
AddPKToEndpointName bool `koanf:"add_pk_to_endpoint_name"`
EndpointName string `koanf:"endpoint_name"`
ContentType string `koanf:"content_type"`
HTTPMethod string `koanf:"http_method"`
EndpointBody map[string]any `koanf:"endpoint_body"`
}
// Inputs represents struct for the inputs instance.
type Inputs struct {
Mapping map[string]int
Data [][]string
}
// Filtered represents struct for the filtered instance.
type Filtered struct {
Data [][]string
}
// Outputs represents struct for the outputs instance.
type Outputs struct {
Data []*Output
}
// Output represents struct for the one output instance.
type Output struct {
ID string
FieldName string
Values []string
}