Versions in this module Expand all Collapse all v1 v1.0.0 Dec 7, 2025 Changes in this version + var ErrStopped = errors.New("component gracefully stopped") + var ErrTargetUnknown = errors.New("target unknown") + var ErrTerminated = errors.New("component terminated") + func ExtractDoc(content, name string) (string, error) + func InjectLogger(ctx context.Context, logger *slog.Logger) context.Context + func Logger(ctx context.Context) *slog.Logger + func MergeTargets(t ...[]string) (targets []string) + func MustExtractDoc(content, name string) string + func Run(body Procedure, opts ...Option) + func RunProc(main Proc, opts ...Option) + type CleanupFunc func() + type Descriptor struct + Aspects []string + Bootstrap func(l *L, target Linker, options any) error + Doc string + Flags flag.FlagSet + Interests []string + Name string + OptionsType reflect.Type + type ForkOption func(*lifecycleOptions) + func WithForkCompletion(done chan struct{}) ForkOption + func WithForkName(name string) ForkOption + type L struct + func (l *L) Cleanup(fn func()) + func (l *L) CleanupBackground(fn func(context.Context) error) + func (l *L) CleanupContext(fn func(context.Context) error) + func (l *L) CleanupError(fn func() error) + func (l *L) Context() context.Context + func (l *L) Continue() bool + func (l *L) Done() <-chan struct{} + func (l *L) Error(err error) + func (l *L) Errorf(format string, a ...any) + func (l *L) Fatal(err error) + func (l *L) Fatalf(format string, a ...any) + func (l *L) Fork(name string, procedure Procedure, opts ...ForkOption) + func (l *L) ForkE(name string, proc ProcE) + func (l *L) Go(name string, proc Proc) + func (l *L) GraceContext() context.Context + func (l *L) Log(args ...any) + func (l *L) Logf(format string, args ...any) + func (l *L) Name() string + func (l *L) Stop(timeout time.Duration) (stopped bool) + func (l *L) Stopping() <-chan struct{} + func (l *L) Terminate() + type Linker interface + LinkAspect func(ctx context.Context, aspect string) (target *pubsub.Topic, err error) + LinkInterest func(ctx context.Context, interest string) (target *pubsub.Subscription, err error) + type Option func(*lifecycleOptions) + func OnComplete(hook func(name string)) Option + func OnStarted(hook func(name string)) Option + func WithCompletion(done chan struct{}) Option + func WithContext(ctx context.Context) Option + func WithForkSpanName(name string) Option + func WithLogger(logger *log.Logger) Option + func WithName(name string) Option + func WithSpan(name string) Option + func WithStopper(stopper <-chan struct{}) Option + type Proc func(*L) + func (f Proc) Exec(l *L) + type ProcE func(*L) error + func (f ProcE) Exec(l *L) + type Procedure interface + Exec func(*L)