Skip to content

feat: add new hooks for healthcheck - #195

Open
GreyXor wants to merge 5 commits into
samber:masterfrom
GreyXor:feat-healthcheck-hooks
Open

feat: add new hooks for healthcheck#195
GreyXor wants to merge 5 commits into
samber:masterfrom
GreyXor:feat-healthcheck-hooks

Conversation

@GreyXor

@GreyXor GreyXor commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Context: #73 (comment)

This add AddBeforeHealthCheckHook and AddAfterHealthCheckHook

Todo:

  • tests
  • doc

I can use it like so

do.DefaultRootScope.AddBeforeHealthCheckHook(func(scope *do.Scope, serviceName string) {
    slog.Debug(serviceName + " service health check")
})

do.DefaultRootScope.AddAfterHealthCheckHook(func(scope *do.Scope, serviceName string) {
    slog.Debug(serviceName + " service health checked")
})

@codecov

codecov Bot commented Feb 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.68%. Comparing base (d9699bc) to head (f18ec97).

Files with missing lines Patch % Lines
virtual_scope.go 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
+ Coverage   91.60%   91.68%   +0.08%     
==========================================
  Files          23       23              
  Lines        1846     1865      +19     
==========================================
+ Hits         1691     1710      +19     
  Misses        155      155              
Flag Coverage Δ
unittests 91.68% <83.87%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GreyXor
GreyXor force-pushed the feat-healthcheck-hooks branch from 019af8f to c1eb569 Compare September 2, 2026 16:28
@GreyXor

GreyXor commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Hello @samber
Finally done! And ready to merge

@LarsArtmann

Copy link
Copy Markdown

I feel like I would like this feature for https://github.com/LarsArtmann/samber-do-auditlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants