Commit Graph

3 Commits

Author SHA1 Message Date
Pablo Baeyens 3b7d066b2b
[configoptional] Add a confmap.Marshaler implementation (#13196)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adds a `confmap.Marshaler` implementation for `configoptional.Optional`

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
2025-06-17 16:57:58 +00:00
Pablo Baeyens 124510585c
[configoptional] Make Unmarshal into None[T] match unmarshal into (*T)(nil) (#13168)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Makes it so that unmarshaling into a `None[T]` is equivalent to
unmarshaling into a `(*T)(nil)`.
The goal is to be able to do #13109 without introducing any changes to
the behavior.

Needs #13161.

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Add a unit test to compare the behavior of unmarshaling into `(*T)(nil)`
with that of unmarshaling into `None[T]`

<!--Describe the documentation added.-->
#### Documentation

Amend docstrings

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
2025-06-10 13:52:44 +00:00
Pablo Baeyens 633b6de37f
[config/configoptional] Add new configoptional module (#13044)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

Adds new `configoptional` module.

I left `GetOrInsertDefault` out of this first PR so we can get agreement
on the basics first.

#### Link to tracking issue

Fixes #12981
Fixes #10266

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->

See #13018 for usage and testing of the package on `confighttp` and
`otlpreceiver`.
2025-05-28 11:20:20 +00:00