fix: we need to pass out the api in both struct and interface form for fx to read it properly
This commit is contained in:
parent
10ecaebbf2
commit
ceabb95f6d
21
api/s5.go
21
api/s5.go
|
@ -45,19 +45,22 @@ type S5ApiParams struct {
|
||||||
|
|
||||||
type S5ApiResult struct {
|
type S5ApiResult struct {
|
||||||
fx.Out
|
fx.Out
|
||||||
Protocol registry.API `group:"api"`
|
API registry.API `group:"api"`
|
||||||
|
S5API *S5API
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewS5(params S5ApiParams) (S5ApiResult, error) {
|
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{
|
return S5ApiResult{
|
||||||
Protocol: &S5API{
|
API: api,
|
||||||
config: params.Config,
|
S5API: api,
|
||||||
identity: params.Identity,
|
|
||||||
accounts: params.Accounts,
|
|
||||||
storage: params.Storage,
|
|
||||||
protocols: params.Protocols,
|
|
||||||
httpHandler: params.HttpHandler,
|
|
||||||
},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue