3
0
mirror of https://github.com/ergochat/ergo.git synced 2026-01-02 08:17:57 +01:00
ergo/irc/history/serialization.go
2025-12-30 23:34:05 -05:00

20 lines
458 B
Go

// Copyright (c) 2020 Shivaram Lingamneni
// released under the MIT license
package history
import (
"encoding/json"
)
// 123 / '{' is the magic number that means JSON;
// if we want to do a binary encoding later, we just have to add different magic version numbers
func MarshalItem(item *Item) (result []byte, err error) {
return json.Marshal(item)
}
func UnmarshalItem(data []byte, result *Item) (err error) {
return json.Unmarshal(data, result)
}