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

33 lines
366 B
Go

package {{Package}}
import (
"log/slog"
"go.uber.org/fx"
)
type {{title Package}} struct {
log *slog.Logger
}
type Params struct {
fx.In
Lc fx.Lifecycle
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
}