HandshakeConfig MagicCookieKey key定死

This commit is contained in:
李子铭 2024-08-08 09:32:49 +08:00
parent 622a368a25
commit ff0ff17055
3 changed files with 6 additions and 9 deletions

View File

@ -11,7 +11,6 @@ func Order(ctx context.Context, tag string, request *proto.OrderRequest) (*proto
if err != nil { if err != nil {
return nil, err return nil, err
} }
//request.Config = srv.Config
return srv.Impl.Order(ctx, request) return srv.Impl.Order(ctx, request)
} }

View File

@ -6,9 +6,8 @@ import (
) )
type PluginInfo struct { type PluginInfo struct {
Tag string Tag string
Impl shared.PluginService Impl shared.PluginService
//Config json.RawMessage
cleanup func() cleanup func()
} }
@ -33,9 +32,8 @@ func (m *pluginManage) add(c *Config) error {
return err return err
} }
m.plugins[c.Tag] = &PluginInfo{ m.plugins[c.Tag] = &PluginInfo{
Tag: c.Tag, Tag: c.Tag,
Impl: impl, Impl: impl,
//Config: c.Config,
cleanup: cleanup, cleanup: cleanup,
} }
return nil return nil

View File

@ -21,10 +21,10 @@ func PluginSet(opts ...*Plugin) plugin.PluginSet {
return plugins return plugins
} }
func HandshakeConfig(version uint, key, value string) plugin.HandshakeConfig { func HandshakeConfig(version uint, value string) plugin.HandshakeConfig {
return plugin.HandshakeConfig{ return plugin.HandshakeConfig{
ProtocolVersion: version, ProtocolVersion: version,
MagicCookieKey: key, MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: value, MagicCookieValue: value,
} }
} }