Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: samber/do

v2.0.0

21 Sep 19:05

Choose a tag to compare

🧭 Migration notes

Migration guide available: https://do.samber.dev/docs/upgrading/from-v1-x-to-v2

⚠️ Breaking changes

  • do.Injector struct turned into an interface
  • injector.ListProvidedServices now returns []do.ServiceDescription
  • injector.ListInvokedServices now returns []do.ServiceDescription
  • No more panic propagation on Provider error
  • Service name in internal registry (eg: *mypkg.MyService -> *github.com/samber/example.MyService)
  • Hooks have been turned into now slices of hooks
  • injector.ShutdownOnSignals and injector.ShutdownOnSIGTERM now returns (os.Signal, error)

🆕 Features

  • New Scope (formerly Injector) with a tree structure: RootScope, child scopes, local or inherited services.
  • Support for transient services: ability to create services that are instantiated on every invocation through a dedicated mode.
  • Support for service aliasing and invocation via interface binding
  • Populate a struct and invoke services when do:"" tag is defined on attributes
  • Improved dependency graph troubleshooting: DAG representation, better tracing of service and scope chains. Added HTTP routes for easier troubleshooting.
  • Circular dependency detection between services, with controlled panic instead of silent failure.
  • Optional stack trace collection when invoking services for debugging purposes.
  • Better error handling in Providers: panics are now converted into error.
  • Support for Healthcheck and Shutdown interfaces, with thread-safe shutdown and invocation handling.
  • More hooks

🛠️ Improvements

  • Consistent error format.
  • Extended test suite with improved coverage (> 90 % target).
  • Refactorings: removed dead code, reduced // @TODOs.
  • Implicit service names now include package path to avoid conflicts.
  • Thread safe service loading and shutdown
  • Parallel service health check and unload
  • Health checks and shutdown methods now receive an optional context and support timeouts

🔍 Doc

v2.0.0-rc1

22 Aug 13:23

Choose a tag to compare

v2.0.0-rc1 Pre-release
Pre-release

Improvements

  • the do.ShutdownXXX methods now return *do.ShutdownReport
  • do.InvokeStruct[T]now returns T instead of *T
  • do.InvokeStruct now supports implicit type aliasing
  • fixed cross-scope service alias
  • do.Service[T] is not exported anymore
  • better thread safety
  • 93% test coverage
  • more examples
  • lots of doc improvements
  • code quality improvements

...and lots of micro-fixes

See #45

v2.0.0-beta.7

13 May 12:17
1998a7a

Choose a tag to compare

v2.0.0-beta.7 Pre-release
Pre-release
  • Upgrade go-type-to-string (add support for arrays) - See #79
  • Fix error handling: add a TypeMismatch error when we invoke a service from an unexpected type - See #80

v2.0.0-beta.6

09 May 23:07
b0f5021

Choose a tag to compare

v2.0.0-beta.6 Pre-release
Pre-release
  • more tests
  • fix typo in doc
  • adding package abstraction (see doc)
  • fix memory leak for invocation stacktraces
  • shutdown services even if we detect a circular dependency
  • upgrade go-type-to-string (improved interface naming)
  • add support for multple hook handlers
  • add hook at runtime

v2.0.0-beta.5

11 Feb 19:04
9393680

Choose a tag to compare

v2.0.0-beta.5 Pre-release
Pre-release

See #45

v2.0.0-beta.4

11 Feb 16:46
7eed21f

Choose a tag to compare

v2.0.0-beta.4 Pre-release
Pre-release

See #45

v2.0.0-beta.3

15 Jan 19:35
27465c8

Choose a tag to compare

v2.0.0-beta.3 Pre-release
Pre-release

See #45

v2.0.0-beta.2

31 Dec 01:43
62946e5

Choose a tag to compare

v2.0.0-beta.2 Pre-release
Pre-release

See #45

v2.0.0-beta.1

06 Dec 00:38
4fce2a2

Choose a tag to compare

v2.0.0-beta.1 Pre-release
Pre-release

See #45

v1.6.0

27 Jan 13:56

Choose a tag to compare

Adds injector.ShutdownOnSignals(...) helper that receives a custom list of signals to listen.