DefaultCodecRegistry is a simple implementation of [CodecRegistry] that allows registering custom [Codec]s.
| 91 | |
| 92 | // DefaultCodecRegistry is a simple implementation of [CodecRegistry] that allows registering custom [Codec]s. |
| 93 | type DefaultCodecRegistry struct { |
| 94 | codecs map[string]Codec |
| 95 | |
| 96 | mu sync.RWMutex |
| 97 | once sync.Once |
| 98 | } |
| 99 | |
| 100 | // NewCodecRegistry returns a new [CodecRegistry], ready to accept custom [Codec]s. |
| 101 | func NewCodecRegistry() *DefaultCodecRegistry { |
nothing calls this directly
no outgoing calls
no test coverage detected