Add countenvelope encoder with marshal/unmarshal support, buffer pool integration, and tests; improve error messages for subscription validation

This commit is contained in:
2025-08-30 16:26:55 +01:00
parent 6c39ea4332
commit 576475e3dc
8 changed files with 353 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ func NewFrom[V string | []byte](eid V, ok bool, msg ...V) *T {
}
if len(eid) != sha256.Size {
log.W.F(
"event ID unexpected length, expect %d got %d",
"event Subscription unexpected length, expect %d got %d",
len(eid), sha256.Size,
)
}
@@ -98,7 +98,7 @@ func (en *T) Unmarshal(b []byte) (r []byte, err error) {
}
if len(idBytes) != sha256.Size {
err = errorf.E(
"invalid size for ID, require %d got %d",
"invalid size for Subscription, require %d got %d",
sha256.Size, len(idBytes),
)
return