Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Commit

Permalink
update api-config.go for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mark4z committed Jan 20, 2021
1 parent 53765d8 commit c63f4eb
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions pkg/api/config/api_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,30 @@ const (

// APIConfig defines the data structure of the api gateway configuration
type APIConfig struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Resources []Resource `json:"resources" yaml:"resources"`
Definitions []Definition `json:"definitions" yaml:"definitions"`
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Resources []Resource `json:"resources" yaml:"resources"`
Definitions []Definition `json:"definitions" yaml:"definitions"`
PluginFilePath string `json:"pluginFilePath" yaml:"pluginFilePath"`
PluginsGroup []PluginsGroup `json:"pluginsGroup" yaml:"pluginsGroup"`
}

type Plugin struct {
Name string `json:"name" yaml:"name"`
Version string `json:"version" yaml:"version"`
Priority int `json:"priority" yaml:"priority"`
ExternalLookupName string `json:"externalLookupName" yaml:"externalLookupName"`
}

// PluginsGroup defines the plugins group info
type PluginsGroup struct {
GroupName string `json:"groupName" yaml:"groupName"`
Plugins []Plugin `json:"plugins" yaml:"plugins"`
}

type PluginsInUse struct {
GroupNames []string `json:"groupNames" yaml:"groupNames"`
PluginNames []string `json:"pluginNames" yaml:"pluginNames"`
}

// Resource defines the API path
Expand All @@ -68,6 +88,7 @@ type Resource struct {
Timeout time.Duration `json:"timeout" yaml:"timeout"`
Description string `json:"description" yaml:"description"`
Filters []string `json:"filters" yaml:"filters"`
Plugins PluginsInUse `json:"plugins" yaml:"plugins"`
Methods []Method `json:"methods" yaml:"methods"`
Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
Expand Down

0 comments on commit c63f4eb

Please sign in to comment.