MCPcopy
hub / github.com/spf13/viper / WithCodecRegistry

Function WithCodecRegistry

encoding.go:81–90  ·  view source on GitHub ↗

WithCodecRegistry sets a custom [EncoderRegistry] and [DecoderRegistry].

(r CodecRegistry)

Source from the content-addressed store, hash-verified

79
80// WithCodecRegistry sets a custom [EncoderRegistry] and [DecoderRegistry].
81func 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.
93type DefaultCodecRegistry struct {

Callers

nothing calls this directly

Calls 1

optionFuncFuncType · 0.85

Tested by

no test coverage detected