aboutsummaryrefslogtreecommitdiff
path: root/meta.go
diff options
context:
space:
mode:
Diffstat (limited to 'meta.go')
-rw-r--r--meta.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/meta.go b/meta.go
index a473ff0..5fafa1d 100644
--- a/meta.go
+++ b/meta.go
@@ -3,7 +3,6 @@ package bolt
var (
InvalidError = &Error{"Invalid database", nil}
VersionMismatchError = &Error{"version mismatch", nil}
- InvalidMetaPageError = &Error{"invalid meta page", nil}
)
const magic uint32 = 0xC0DEC0DE
@@ -12,10 +11,10 @@ const version uint32 = 1
type meta struct {
magic uint32
version uint32
- sys bucket
pageSize uint32
pgid pgid
txnid txnid
+ sys bucket
}
// validate checks the marker bytes and version of the meta page to ensure it matches this binary.
@@ -27,3 +26,11 @@ func (m *meta) validate() error {
}
return nil
}
+
+// copy copies one meta object to another.
+func (m *meta) copy(dest *meta) {
+ dest.pageSize = m.pageSize
+ dest.pgid = m.pgid
+ dest.txnid = m.txnid
+ dest.sys = m.sys
+}