Skip to content

Release v2.2.0: Add fluent API and simplified lifecycle management Latest

Choose a tag to compare

@ognick ognick released this 24 Nov 21:45
· 17 commits to main since this release
  • Add Register() helper function for fluent component registration
  • Add Run() helper function for simplified lifecycle execution
  • Enhance lifecycle management with improved error handling
  • Add comprehensive test coverage for new functionality
  • Update example application with new API usage
  • Improve component dependency management and startup order
  • Add support for graceful shutdown hooks with WithShutdownHook()
  • Enhance lifecycle status transitions and error propagation

BREAKING CHANGES:

  • Lifecycle.Run() method signature changed:
  • OLD: Run(ctx context.Context, readinessProbe func(err error)) func() error
  • NEW: Run(ctx context.Context, readinessProbe func(err error)) error
  • Lifecycle is now a Component without casting
  • Added blocking Run() helper method with callback support
  • Lifecycle no longer shuts down on signals by default (use WithShutdownHook() option)

Migration guide:

  • Replace: waitFn := lc.Run(ctx, probe); err := waitFn()
  • With: err := lc.Run(ctx, probe)
  • Use goscade.Run() helper for blocking execution with callback
  • Add WithShutdownHook() option if signal handling is needed