From ceabb95f6d40095cb7a9e4330948cb03e06eb481 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 28 Jan 2024 04:01:36 -0500 Subject: [PATCH] fix: we need to pass out the api in both struct and interface form for fx to read it properly --- api/s5.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/api/s5.go b/api/s5.go index 175b366..4d794a9 100644 --- a/api/s5.go +++ b/api/s5.go @@ -45,19 +45,22 @@ type S5ApiParams struct { type S5ApiResult struct { fx.Out - Protocol registry.API `group:"api"` + API registry.API `group:"api"` + S5API *S5API } func NewS5(params S5ApiParams) (S5ApiResult, error) { + api := &S5API{ + config: params.Config, + identity: params.Identity, + accounts: params.Accounts, + storage: params.Storage, + protocols: params.Protocols, + httpHandler: params.HttpHandler, + } return S5ApiResult{ - Protocol: &S5API{ - config: params.Config, - identity: params.Identity, - accounts: params.Accounts, - storage: params.Storage, - protocols: params.Protocols, - httpHandler: params.HttpHandler, - }, + API: api, + S5API: api, }, nil }