@@ -11,7 +11,6 @@ import (
1111 "github.com/pkg/errors"
1212
1313 "github.com/httprunner/funplugin/fungo"
14- "github.com/httprunner/funplugin/shared"
1514)
1615
1716type rpcType string
@@ -29,7 +28,7 @@ func (t rpcType) String() string {
2928type hashicorpPlugin struct {
3029 client * plugin.Client
3130 rpcType rpcType
32- funcCaller shared .IFuncCaller
31+ funcCaller fungo .IFuncCaller
3332 cachedFunctions sync.Map // cache loaded functions to improve performance, key is function name, value is bool
3433 path string // plugin file path
3534 option * pluginOption
@@ -42,7 +41,7 @@ func newHashicorpPlugin(path string, option *pluginOption) (*hashicorpPlugin, er
4241 }
4342
4443 // plugin type, grpc or rpc
45- p .rpcType = rpcType (os .Getenv (shared .PluginTypeEnvName ))
44+ p .rpcType = rpcType (os .Getenv (fungo .PluginTypeEnvName ))
4645 if p .rpcType != rpcTypeRPC {
4746 p .rpcType = rpcTypeGRPC // default
4847 }
@@ -66,12 +65,12 @@ func newHashicorpPlugin(path string, option *pluginOption) (*hashicorpPlugin, er
6665 // hashicorp go plugin
6766 cmd = exec .Command (path )
6867 }
69- cmd .Env = append (os .Environ (), fmt .Sprintf ("%s=%s" , shared .PluginTypeEnvName , p .rpcType ))
68+ cmd .Env = append (os .Environ (), fmt .Sprintf ("%s=%s" , fungo .PluginTypeEnvName , p .rpcType ))
7069
7170 // launch the plugin process
7271 logger .Info ("launch the plugin process" )
7372 p .client = plugin .NewClient (& plugin.ClientConfig {
74- HandshakeConfig : shared .HandshakeConfig ,
73+ HandshakeConfig : fungo .HandshakeConfig ,
7574 Plugins : map [string ]plugin.Plugin {
7675 rpcTypeRPC .String (): & fungo.RPCPlugin {},
7776 rpcTypeGRPC .String (): & fungo.GRPCPlugin {},
@@ -98,7 +97,7 @@ func newHashicorpPlugin(path string, option *pluginOption) (*hashicorpPlugin, er
9897
9998 // We should have a Function now! This feels like a normal interface
10099 // implementation but is in fact over an RPC connection.
101- p .funcCaller = raw .(shared .IFuncCaller )
100+ p .funcCaller = raw .(fungo .IFuncCaller )
102101
103102 p .cachedFunctions = sync.Map {}
104103 logger .Info ("load hashicorp go plugin success" , "path" , path )
0 commit comments