1
0
Fork 0

Add http-wasm plugin support to Traefik

This commit is contained in:
Jesse Haka 2023-11-30 22:42:06 +02:00 committed by GitHub
parent b2bb96390a
commit 6858dbdd07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 338 additions and 119 deletions

View file

@ -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 == ""
}