github.com/go-tstr/tstr/dep/depfn
go get github.com/go-tstr/tstr/dep/depfn@v0.2.2
Types
type DepFn
type DepFn struct {
// contains filtered or unexported fields
}func New
func New(start, ready, stop func() error) DepFnNew creates a new DepFn with the provided start, ready, and stop functions. If any of the functions is nil, it will be treated as a no-op and nil is returned when they are called. This provides a simple way to create dependencies without needing to implement the full Dependency interface.
func (DepFn) Ready
func (f DepFn) Ready() errorfunc (DepFn) Start
func (f DepFn) Start() errorfunc (DepFn) Stop
func (f DepFn) Stop() error