NewCodecRegistry returns a new [CodecRegistry], ready to accept custom [Codec]s.
()
| 99 | |
| 100 | // NewCodecRegistry returns a new [CodecRegistry], ready to accept custom [Codec]s. |
| 101 | func NewCodecRegistry() *DefaultCodecRegistry { |
| 102 | r := &DefaultCodecRegistry{} |
| 103 | |
| 104 | r.init() |
| 105 | |
| 106 | return r |
| 107 | } |
| 108 | |
| 109 | func (r *DefaultCodecRegistry) init() { |
| 110 | r.once.Do(func() { |