Typ returns a human-readable page type string used for debugging.
()
| 46 | |
| 47 | // Typ returns a human-readable page type string used for debugging. |
| 48 | func (p *Page) Typ() string { |
| 49 | if p.IsBranchPage() { |
| 50 | return "branch" |
| 51 | } else if p.IsLeafPage() { |
| 52 | return "leaf" |
| 53 | } else if p.IsMetaPage() { |
| 54 | return "meta" |
| 55 | } else if p.IsFreelistPage() { |
| 56 | return "freelist" |
| 57 | } |
| 58 | return fmt.Sprintf("unknown<%02x>", p.flags) |
| 59 | } |
| 60 | |
| 61 | func (p *Page) IsBranchPage() bool { |
| 62 | return p.flags == BranchPageFlag |