@@ -55,10 +55,30 @@ const (
5555
5656// APIConfig defines the data structure of the api gateway configuration
5757type 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"`
6282}
6383
6484// Resource defines the API path
@@ -68,6 +88,7 @@ type Resource struct {
6888 Timeout time.Duration `json:"timeout" yaml:"timeout"`
6989 Description string `json:"description" yaml:"description"`
7090 Filters []string `json:"filters" yaml:"filters"`
91+ Plugins PluginsInUse `json:"plugins" yaml:"plugins"`
7192 Methods []Method `json:"methods" yaml:"methods"`
7293 Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
7394 Headers map [string ]string `json:"headers,omitempty" yaml:"headers,omitempty"`
0 commit comments