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

38 lines
472 B
Go

package {{Package}}
import (
"context"
"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
}
func (o *{{title Package}}) Health(ctx context.Context) (bool, error) {
return true, nil
}