From b374498538a1e62c68baa0259ad3dfcda1cf9524 Mon Sep 17 00:00:00 2001 From: Noku Date: Sat, 21 Oct 2023 02:36:42 +0800 Subject: [PATCH] feat(document): add `WithId` in bingo.Document --- document.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/document.go b/document.go index 44f5aef..35b0e73 100644 --- a/document.go +++ b/document.go @@ -7,3 +7,8 @@ type Document struct { func (d Document) Key() []byte { return []byte(d.ID) } + +func (d Document) WithId(id string) Document { + d.ID = id + return d +}