Skip to content

[flagd] Change provider option types to time.Duration and remove ms postfix from variable names #816

@alexandraoberaigner

Description

@alexandraoberaigner

Summary
Update the flagd provider to use time.Duration types for options that represent durations. Also, update variable names to remove the ms postfix, as duration values will no longer be strictly milliseconds.

This change should not affect any existing environment variable formats; those should remain as they are to maintain consistency across providers and accommodate languages that do not support a similar duration representation.

Options to change
-retryGracePeriod
-retryBackoffMs
-retryBackoffMaxMs

see also https://flagd.dev/reference/specifications/providers/#configuration-options

Reasoning

  • Using time.Duration is idiomatic in Go and improves type safety/expressiveness for time-based fields.
  • Removing the ms postfix from variable names clears up ambiguity, since durations can be provided in any valid Go duration format.
  • Env variables must remain as-is to ensure all providers use the same interface; some languages lack an equivalent type for durations.

Additional Context
This came up during PR review of #806 by @sahidvelji

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions