home/.config/boilr/templates/fx/template/component.go

31 lines
342 B
Go

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
}