sshpiper/e2e/testplugin/testsetmetaplugin/main.go
Josh Bleecher Snyder 89ab72bee0
all: run gofumpt (#652)
* all: run gofumpt

https://github.com/mvdan/gofumpt

The main appeal for me here is that my (and many other peoples')
editors run this on save, so doing a single diff here
keeps other diffs minimal.

* .github/workflows: add gofumpt checker
2025-08-29 20:04:31 -07:00

31 lines
715 B
Go

//go:build e2e
package main
import (
"github.com/tg123/sshpiper/libplugin"
"github.com/urfave/cli/v2"
)
func main() {
libplugin.CreateAndRunPluginTemplate(&libplugin.PluginTemplate{
Name: "setmeta",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "targetaddr",
Required: true,
},
},
CreateConfig: func(ctx *cli.Context) (*libplugin.SshPiperPluginConfig, error) {
return &libplugin.SshPiperPluginConfig{
NoClientAuthCallback: func(conn libplugin.ConnMetadata) (*libplugin.Upstream, error) {
return &libplugin.Upstream{
Auth: libplugin.CreateNextPluginAuth(map[string]string{
"targetaddr": ctx.String("targetaddr"),
}),
}, nil
},
}, nil
},
})
}