internal/godoc/codec: encoding registered types
internal/godoc/codec: encoding registered types

This CL starts the work for encoding an arbitrary type. EncodeAny
accepts an interface{} and tries to encode it. To do so, the value's
type has to be registered with an encoding and decoding function.
The encoder stores a number identifying the type along with its
encoded value.

In the next CL we'll see how the Decoder uses the Encoder's
type information along with the registry to decode types.

Change-Id: I60e8766adfaff9622e22d474280e55b401460a62
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264123
Trust: Jonathan Amsterdam <e3d3698b2ccd5955e4adf250d0785062d0f9018b@google.com>
Run-TryBot: Jonathan Amsterdam <e3d3698b2ccd5955e4adf250d0785062d0f9018b@google.com>
Reviewed-by: Julie Qiu <8d32267b6b4884cf35adeaccde2b6857ae11aace@golang.org>
Reviewed-by: Jamal Carvalho <e0195770807aa8c82b0b128d9c0423b5ad035172@golang.org>

golang/pkgsite,golang/pkgsite,golang/pkgsite,golang/pkgsite