Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 0e6c447

Browse files
committed
feat: add INSTANT_CODEC for Instant serialization and deserialization
1 parent 6abd1a8 commit 0e6c447

File tree

1 file changed

+2
-0
lines changed
  • surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/netty/network/codec

1 file changed

+2
-0
lines changed

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/netty/network/codec/ByteBufCodecs.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ object ByteBufCodecs {
171171
{ epoch, zoneId -> ZonedDateTime.ofInstant(Instant.ofEpochMilli(epoch), ZoneId.of(zoneId)) }
172172
)
173173

174+
val INSTANT_CODEC = LONG_CODEC.map(Instant::ofEpochMilli, Instant::toEpochMilli)
175+
174176
val DURATION_CODEC = streamCodecComposite(
175177
LONG_CODEC,
176178
Duration::inWholeMilliseconds

0 commit comments

Comments
 (0)