github.com/TykTechnologies/tyk/cli/plugin
No package summary is available.
Package
Files: 1. Third party imports: 1. Imports from organisation: 0. Tests: 0. Benchmarks: 0.
Constants
const (
cmdName = "plugin"
cmdDesc = "Load plugin test"
)
Vars
var loader = &pluginLoader{}
Types
pluginLoader
This type doesn't have documentation.
| Field name | Field type | Comment |
|---|---|---|
| file |
|
No comment on field. |
| symbol |
|
No comment on field. |
type pluginLoader struct {
file *string
symbol *string
}
Functions
func AddTo
AddTo initializes an importer object.
func AddTo(app *kingpin.Application) {
cmd := app.Command(cmdName, cmdDesc)
buildCmd := cmd.Command("load", "Load a plugin")
loader.file = buildCmd.Flag("file", "Key for bundle signature").Short('f').String()
loader.symbol = buildCmd.Flag("symbol", "Function symbol name").Short('s').String()
buildCmd.Action(loader.Load)
}
Cognitive complexity: 0, Cyclomatic complexity: 1
func (*pluginLoader) Load
Load tries to load a plugin
func (p *pluginLoader) Load(_ *kingpin.ParseContext) (err error) {
defer func() {
if thrown := recover(); thrown != nil {
err = fmt.Errorf("unexpected panic: %v", thrown)
}
}()
err = p.load()
return
}
Cognitive complexity: 3, Cyclomatic complexity: 2
Private functions
func info
info (message string)
func load
load () error
References: fmt.Errorf, fmt.Printf, goplugin.GetSymbol, strings.Split.