Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate unused configx option #811

Merged
merged 2 commits into from
Oct 21, 2024
Merged
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
5 changes: 2 additions & 3 deletions configx/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ func WithUserProviders(providers ...koanf.Provider) OptionModifier {
}
}

// DEPRECATED without replacement. This option is a no-op.
func OmitKeysFromTracing(keys ...string) OptionModifier {
return func(p *Provider) {
p.excludeFieldsFromTracing = keys
}
return func(*Provider) {}
}

func AttachWatcher(watcher func(event watcherx.Event, err error)) OptionModifier {
Expand Down
22 changes: 10 additions & 12 deletions configx/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ type Provider struct {
*koanf.Koanf
immutables, exceptImmutables []string

schema []byte
flags *pflag.FlagSet
validator *jsonschema.Schema
onChanges []func(watcherx.Event, error)
onValidationError func(k *koanf.Koanf, err error)
excludeFieldsFromTracing []string
schema []byte
flags *pflag.FlagSet
validator *jsonschema.Schema
onChanges []func(watcherx.Event, error)
onValidationError func(k *koanf.Koanf, err error)

forcedValues []tuple
baseValues []tuple
Expand Down Expand Up @@ -91,12 +90,11 @@ func New(ctx context.Context, schema []byte, modifiers ...OptionModifier) (*Prov
l.Out = io.Discard

p := &Provider{
schema: schema,
validator: validator,
onValidationError: func(k *koanf.Koanf, err error) {},
excludeFieldsFromTracing: []string{"dsn", "secret", "password", "key"},
logger: logrusx.New("discarding config logger", "", logrusx.UseLogger(l)),
Koanf: koanf.NewWithConf(koanf.Conf{Delim: Delimiter, StrictMerge: true}),
schema: schema,
validator: validator,
onValidationError: func(k *koanf.Koanf, err error) {},
logger: logrusx.New("discarding config logger", "", logrusx.UseLogger(l)),
Koanf: koanf.NewWithConf(koanf.Conf{Delim: Delimiter, StrictMerge: true}),
}

for _, m := range modifiers {
Expand Down
Loading