Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/single-file-example/hooks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func Handle(_ context.Context, input *pkg.HookInput) error {
return nil
}

// func ReadinessFunc(ctx context.Context, input *pkg.ReadinessInput) error {
func ReadinessFunc(ctx context.Context, input *pkg.HookInput) error {
input.Logger.Info("start user logic for readiness probe")

Expand Down
1 change: 1 addition & 0 deletions pkg/app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type readinessConfig struct {
IntervalInSeconds uint8 `env:"INTERVAL_IN_SECONDS"`
// TODO: not implemented
Threshold int
// ProbeFunc func(ctx context.Context, input *pkg.ReadinessInput) error
ProbeFunc func(ctx context.Context, input *pkg.HookInput) error
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/app/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ func WithReadiness(cfg *ReadinessConfig) RunConfigOption {

type ReadinessConfig struct {
IntervalInSeconds uint8
ProbeFunc func(ctx context.Context, input *pkg.HookInput) error
// ProbeFunc func(ctx context.Context, input *pkg.ReadinessInput) error
ProbeFunc func(ctx context.Context, input *pkg.HookInput) error
}

func WithSettingsCheck(check settingscheck.Check) RunConfigOption {
Expand Down
10 changes: 10 additions & 0 deletions pkg/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ type ApplicationHookInput struct {
Logger Logger
}

type ReadinessInput struct {
Values ReadableValuesCollector
ConfigValues ReadableValuesCollector
MetricsCollector MetricsCollector

DC DependencyContainer

Logger Logger
}

// Instance provides access to application instance metadata.
type Instance interface {
// Name returns application instance name
Expand Down
Loading