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

41 lines
532 B
Go
Raw Normal View History

2024-03-26 21:11:16 +00:00
package {{Package}}
import (
2024-04-03 04:34:54 +00:00
"context"
2024-03-26 21:18:01 +00:00
"log/slog"
2024-03-26 21:11:16 +00:00
2024-03-26 21:18:01 +00:00
"go.uber.org/fx"
2024-04-12 19:03:58 +00:00
"gfx.cafe/util/go/fxplus"
2024-03-26 21:11:16 +00:00
)
type {{title Package}} struct {
log *slog.Logger
}
type Params struct {
2024-03-26 21:18:01 +00:00
fx.In
2024-03-26 21:11:16 +00:00
2024-03-26 21:18:01 +00:00
Lc fx.Lifecycle
2024-03-26 21:11:16 +00:00
Log *slog.Logger
}
type Result struct {
2024-03-26 21:18:01 +00:00
fx.Out
2024-03-26 21:11:16 +00:00
2024-03-26 21:18:01 +00:00
Output *{{title Package}}
2024-04-12 19:03:58 +00:00
Healther fxplus.Healther
2024-03-26 21:11:16 +00:00
}
func New(p Params) (r Result, err error) {
o := &{{title Package}}{}
o.log = p.Log
2024-03-26 21:18:01 +00:00
2024-03-26 21:11:16 +00:00
r.Output = o
2024-04-12 19:03:58 +00:00
r.Healther = o
2024-03-26 21:11:16 +00:00
return
}
2024-04-03 04:34:54 +00:00
2024-04-12 19:03:58 +00:00
func (o *{{title Package}}) Health(ctx context.Context) (error) {
return nil
2024-04-03 04:34:54 +00:00
}