INNER CODE UNIT · Go
init
resgateio/resgate · server/apiEncoding.go:123
func init() {
b, err := json.Marshal(reserr.ErrNotFound)
if err != nil {
panic(err)
}
RegisterAPIEncoderFactory("json", func(cfg Config) APIEncoder {
return &encoderJSON{apiPath: cfg.APIPath, notFoundBytes: b}
})
RegisterAPIEncoderFactory("jsonflat", func(cfg Config) APIEncoder {
return &encoderJSONFlat{apiPath: cfg.APIPath, notFoundBytes: b}
})
}
type encoderJSON struct {
b bytes.Buffer
path []string