mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
This is so weird. this works in tests but not when running the application. I guess there is some weird global state race condition going on because its used by antelope-go. Should rewrite the jsontime api because I have forked it anyway.
20 lines
394 B
Go
20 lines
394 B
Go
package json
|
|
|
|
import (
|
|
jsontime "github.com/eosswedenorg-go/jsontime/v2"
|
|
"github.com/eosswedenorg/thalos/api/message"
|
|
)
|
|
|
|
func createCodec() message.Codec {
|
|
json_codec := jsontime.ConfigWithCustomTimeFormat
|
|
|
|
return message.Codec{
|
|
Encoder: json_codec.Marshal,
|
|
Decoder: json_codec.Unmarshal,
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
// Register the json codec.
|
|
message.RegisterCodec("json", createCodec())
|
|
}
|