fix: we need to pass out the protocol in both struct and interface form for fx to read it properly
This commit is contained in:
parent
98c1784518
commit
10ecaebbf2
|
@ -45,7 +45,8 @@ type S5ProtocolParams struct {
|
||||||
|
|
||||||
type S5ProtocolResult struct {
|
type S5ProtocolResult struct {
|
||||||
fx.Out
|
fx.Out
|
||||||
Protocol registry.Protocol `group:"protocol"`
|
Protocol registry.Protocol `group:"protocol"`
|
||||||
|
S5Protocol *S5Protocol
|
||||||
}
|
}
|
||||||
|
|
||||||
var S5ProtocolModule = fx.Module("s5_protocol",
|
var S5ProtocolModule = fx.Module("s5_protocol",
|
||||||
|
@ -56,14 +57,17 @@ var S5ProtocolModule = fx.Module("s5_protocol",
|
||||||
func NewS5Protocol(
|
func NewS5Protocol(
|
||||||
params S5ProtocolParams,
|
params S5ProtocolParams,
|
||||||
) (S5ProtocolResult, error) {
|
) (S5ProtocolResult, error) {
|
||||||
|
proto := &S5Protocol{
|
||||||
|
config: params.Config,
|
||||||
|
logger: params.Logger,
|
||||||
|
storage: params.Storage,
|
||||||
|
identity: params.Identity,
|
||||||
|
providerStore: params.ProviderStore,
|
||||||
|
}
|
||||||
|
|
||||||
return S5ProtocolResult{
|
return S5ProtocolResult{
|
||||||
Protocol: &S5Protocol{
|
Protocol: proto,
|
||||||
config: params.Config,
|
S5Protocol: proto,
|
||||||
logger: params.Logger,
|
|
||||||
storage: params.Storage,
|
|
||||||
identity: params.Identity,
|
|
||||||
providerStore: params.ProviderStore,
|
|
||||||
},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue