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

Commit 49707be

Browse files
committed
defines the pre & post plugins
1 parent 4a50b7f commit 49707be

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/api/base.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ package api
1919

2020
type ApiType int32
2121

22-
const (
23-
REST_VALUE = "REST"
24-
GRPC_VALUE = "GRPC"
25-
DUBBO_VALUE = "DUBBO"
26-
)
27-
2822
// Status is the components status
2923
type Status int32
3024

pkg/api/config/api_config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ type PluginsGroup struct {
7676
Plugins []Plugin `json:"plugins" yaml:"plugins"`
7777
}
7878

79+
//PluginsConfig defines the pre & post plugins
80+
type PluginsConfig struct {
81+
PrePlugins []*PluginsInUse `json:"pre" yaml:"pre"`
82+
PostPlugins []*PluginsInUse `json:"post" yaml:"post"`
83+
}
84+
7985
type PluginsInUse struct {
8086
GroupNames []string `json:"groupNames" yaml:"groupNames"`
8187
PluginNames []string `json:"pluginNames" yaml:"pluginNames"`
@@ -88,7 +94,7 @@ type Resource struct {
8894
Timeout time.Duration `json:"timeout" yaml:"timeout"`
8995
Description string `json:"description" yaml:"description"`
9096
Filters []string `json:"filters" yaml:"filters"`
91-
Plugins PluginsInUse `json:"plugins" yaml:"plugins"`
97+
Plugins PluginsConfig `json:"plugins" yaml:"plugins"`
9298
Methods []Method `json:"methods" yaml:"methods"`
9399
Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"`
94100
Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`

0 commit comments

Comments
 (0)