This commit is contained in:
a 2024-03-26 16:11:16 -05:00
commit b1f7b8ff68
Signed by: a
GPG Key ID: 374BC539FE795AF0
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,5 @@
{
"Name": "fx",
"Description": "create an fx component",
"Package":""
}

View File

@ -0,0 +1,30 @@
package {{Package}}
import (
"log/slog"
"go.uber.org/fx"
)
type {{title Package}} struct {
log *slog.Logger
}
type Params struct {
fx.In
Log *slog.Logger
}
type Result struct {
fx.Out
Output *{{title Package}}
}
func New(p Params) (r Result, err error) {
o := &{{title Package}}{}
o.log = p.Log
r.Output = o
return
}