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
|
@ -46,6 +46,7 @@ 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) {
|
||||||
return S5ProtocolResult{
|
proto := &S5Protocol{
|
||||||
Protocol: &S5Protocol{
|
|
||||||
config: params.Config,
|
config: params.Config,
|
||||||
logger: params.Logger,
|
logger: params.Logger,
|
||||||
storage: params.Storage,
|
storage: params.Storage,
|
||||||
identity: params.Identity,
|
identity: params.Identity,
|
||||||
providerStore: params.ProviderStore,
|
providerStore: params.ProviderStore,
|
||||||
},
|
}
|
||||||
|
|
||||||
|
return S5ProtocolResult{
|
||||||
|
Protocol: proto,
|
||||||
|
S5Protocol: proto,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue