MCPcopy Create free account
hub / github.com/pace/bricks / WithCustomStateSetter

Function WithCustomStateSetter

maintenance/failover/failover.go:60–71  ·  view source on GitHub ↗
(fn func(ctx context.Context, state string) error)

Source from the content-addressed store, hash-verified

58type ActivePassiveOption func(*ActivePassive) error
59
60func WithCustomStateSetter(fn func(ctx context.Context, state string) error) ActivePassiveOption {
61 return func(ap *ActivePassive) error {
62 stateSetter, err := NewCustomStateSetter(fn)
63 if err != nil {
64 return fmt.Errorf("failed to create state setter: %w", err)
65 }
66
67 ap.stateSetter = stateSetter
68
69 return nil
70 }
71}
72
73func WithNoopStateSetter() ActivePassiveOption {
74 return func(ap *ActivePassive) error {

Callers

nothing calls this directly

Calls 2

NewCustomStateSetterFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…