1
0
Fork 0

Support syscall

This commit is contained in:
David 2025-10-17 17:46:05 +02:00 committed by GitHub
parent 05de0670ea
commit d1ab6ed489
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 247 additions and 8 deletions

View file

@ -0,0 +1,3 @@
module testpluginsafe
go 1.23.0

View file

@ -0,0 +1,21 @@
package testpluginsafe
import (
"context"
"net/http"
)
type Config struct {
Message string
}
func CreateConfig() *Config {
return &Config{Message: "safe plugin"}
}
func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) {
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
rw.Header().Set("X-Test-Plugin", "safe")
next.ServeHTTP(rw, req)
}), nil
}