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

19 lines
382 B
Go

package json
import (
"time"
"github.com/eosswedenorg/thalos/api/message"
jsontime "github.com/liamylian/jsontime/v2/v2"
)
var json_codec = jsontime.ConfigWithCustomTimeFormat
func init() {
jsontime.SetDefaultTimeFormat("2006-01-02T15:04:05.000", time.UTC)
message.RegisterCodec("json", message.Codec{
Encoder: json_codec.Marshal,
Decoder: json_codec.Unmarshal,
})
}