Add http-wasm plugin support to Traefik
This commit is contained in:
parent
b2bb96390a
commit
6858dbdd07
9 changed files with 338 additions and 119 deletions
|
@ -1,5 +1,15 @@
|
|||
package plugins
|
||||
|
||||
const (
|
||||
runtimeYaegi = "yaegi"
|
||||
runtimeWasm = "wasm"
|
||||
)
|
||||
|
||||
const (
|
||||
typeMiddleware = "middleware"
|
||||
typeProvider = "provider"
|
||||
)
|
||||
|
||||
// Descriptor The static part of a plugin configuration.
|
||||
type Descriptor struct {
|
||||
// ModuleName (required)
|
||||
|
@ -19,9 +29,17 @@ type LocalDescriptor struct {
|
|||
type Manifest struct {
|
||||
DisplayName string `yaml:"displayName"`
|
||||
Type string `yaml:"type"`
|
||||
Runtime string `yaml:"runtime"`
|
||||
WasmPath string `yaml:"wasmPath"`
|
||||
Import string `yaml:"import"`
|
||||
BasePkg string `yaml:"basePkg"`
|
||||
Compatibility string `yaml:"compatibility"`
|
||||
Summary string `yaml:"summary"`
|
||||
TestData map[string]interface{} `yaml:"testData"`
|
||||
}
|
||||
|
||||
// IsYaegiPlugin returns true if the plugin is a Yaegi plugin.
|
||||
func (m *Manifest) IsYaegiPlugin() bool {
|
||||
// defaults always Yaegi to have backwards compatibility to plugins without runtime
|
||||
return m.Runtime == runtimeYaegi || m.Runtime == ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue