1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00
thalos/api/message/json/codec.go
Henrik Hautakoski 2b3dc35393 jsontime: skip aliases and use actual format and location
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.
2024-06-22 17:39:10 +02:00

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())
}