MCPcopy
hub / github.com/etcd-io/bbolt / Validate

Method Validate

internal/common/meta.go:25–34  ·  view source on GitHub ↗

Validate checks the marker bytes and version of the meta page to ensure it matches this binary.

()

Source from the content-addressed store, hash-verified

23
24// Validate checks the marker bytes and version of the meta page to ensure it matches this binary.
25func (m *Meta) Validate() error {
26 if m.magic != Magic {
27 return errors.ErrInvalid
28 } else if m.version != Version {
29 return errors.ErrVersionMismatch
30 } else if m.checksum != m.Sum64() {
31 return errors.ErrChecksum
32 }
33 return nil
34}
35
36// Copy copies one meta object to another.
37func (m *Meta) Copy(dest *Meta) {

Callers 4

mmapMethod · 0.45
metaMethod · 0.45

Calls 1

Sum64Method · 0.95

Tested by

no test coverage detected