From 7e16f584de1126f6b4d85399556fa8f160db8f36 Mon Sep 17 00:00:00 2001 From: Pham-Gia-Huong Date: Tue, 8 Mar 2022 17:32:21 +0700 Subject: [PATCH] SSR-2114: Add NewRecordWithIdAndRevision function --- record.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/record.go b/record.go index e2ec6c3..ac4c8dc 100644 --- a/record.go +++ b/record.go @@ -39,6 +39,12 @@ func NewRecordWithId(id uint64, fields map[string]interface{}) *Record { return &Record{id, -1, fields} } +// NewRecordWithIdAndRevision creates using an existing record id and revision. +func NewRecordWithIdAndRevision(id uint64, revision int64, fields map[string]interface{}) *Record { + return &Record{id, revision, fields} + +} + // MarshalJSON marshals field data of a record into JSON. func (rec Record) MarshalJSON() ([]byte, error) { return json.Marshal(rec.Fields)