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

31 lines
342 B
Go
Raw Normal View History

2024-03-26 21:11:16 +00:00
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
}