WithCodecRegistry sets a custom [EncoderRegistry] and [DecoderRegistry].
(r CodecRegistry)
| 79 | |
| 80 | // WithCodecRegistry sets a custom [EncoderRegistry] and [DecoderRegistry]. |
| 81 | func WithCodecRegistry(r CodecRegistry) Option { |
| 82 | return optionFunc(func(v *Viper) { |
| 83 | if r == nil { |
| 84 | return |
| 85 | } |
| 86 | |
| 87 | v.encoderRegistry = r |
| 88 | v.decoderRegistry = r |
| 89 | }) |
| 90 | } |
| 91 | |
| 92 | // DefaultCodecRegistry is a simple implementation of [CodecRegistry] that allows registering custom [Codec]s. |
| 93 | type DefaultCodecRegistry struct { |
nothing calls this directly
no test coverage detected