@@ -55,10 +55,30 @@ const (
55
55
56
56
// APIConfig defines the data structure of the api gateway configuration
57
57
type APIConfig struct {
58
- Name string `json:"name" yaml:"name"`
59
- Description string `json:"description" yaml:"description"`
60
- Resources []Resource `json:"resources" yaml:"resources"`
61
- Definitions []Definition `json:"definitions" yaml:"definitions"`
58
+ Name string `json:"name" yaml:"name"`
59
+ Description string `json:"description" yaml:"description"`
60
+ Resources []Resource `json:"resources" yaml:"resources"`
61
+ Definitions []Definition `json:"definitions" yaml:"definitions"`
62
+ PluginFilePath string `json:"pluginFilePath" yaml:"pluginFilePath"`
63
+ PluginsGroup []PluginsGroup `json:"pluginsGroup" yaml:"pluginsGroup"`
64
+ }
65
+
66
+ type Plugin struct {
67
+ Name string `json:"name" yaml:"name"`
68
+ Version string `json:"version" yaml:"version"`
69
+ Priority int `json:"priority" yaml:"priority"`
70
+ ExternalLookupName string `json:"externalLookupName" yaml:"externalLookupName"`
71
+ }
72
+
73
+ // PluginsGroup defines the plugins group info
74
+ type PluginsGroup struct {
75
+ GroupName string `json:"groupName" yaml:"groupName"`
76
+ Plugins []Plugin `json:"plugins" yaml:"plugins"`
77
+ }
78
+
79
+ type PluginsInUse struct {
80
+ GroupNames []string `json:"groupNames" yaml:"groupNames"`
81
+ PluginNames []string `json:"pluginNames" yaml:"pluginNames"`
62
82
}
63
83
64
84
// Resource defines the API path
@@ -68,6 +88,7 @@ type Resource struct {
68
88
Timeout time.Duration `json:"timeout" yaml:"timeout"`
69
89
Description string `json:"description" yaml:"description"`
70
90
Filters []string `json:"filters" yaml:"filters"`
91
+ Plugins PluginsInUse `json:"plugins" yaml:"plugins"`
71
92
Methods []Method `json:"methods" yaml:"methods"`
72
93
Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
73
94
Headers map [string ]string `json:"headers,omitempty" yaml:"headers,omitempty"`
0 commit comments