refactor: need to use a param struct to get protocol value group

This commit is contained in:
Derrick Hammer 2024-02-17 03:28:05 -05:00
parent afc0b7a343
commit 857ffe4fdd
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 2 deletions

View File

@ -26,8 +26,12 @@ func BuildProtocols(config *viper.Viper) fx.Option {
}
}
options = append(options, fx.Invoke(func(protocols []registry.Protocol) error {
for _, protocol := range protocols {
type initParams struct {
Protocols []registry.Protocol `group:"protocol"`
}
options = append(options, fx.Invoke(func(params initParams) error {
for _, protocol := range params.Protocols {
err := protocol.Init()
if err != nil {
return err