summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandomChars <random@chars.jp>2021-09-30 14:58:33 +0900
committerRandomChars <random@chars.jp>2021-09-30 14:58:33 +0900
commitaf7edeb4db799ff3075cbab73f6bb5f06612205d (patch)
tree50b8d27b7f641b708ef60c30e28ccd0707e9cd9c
parent18224a06f95747443f5f9c9fc86ebe01d1d3f312 (diff)
export page sizev1.3.0
-rw-r--r--store/page.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/store/page.go b/store/page.go
index 5cfa437..f5c555f 100644
--- a/store/page.go
+++ b/store/page.go
@@ -8,7 +8,7 @@ import (
"os"
)
-const pageSize = 64
+const PageSize = 64
// pageDB returns leveldb of page variant and creates it as required.
func (s *Store) pageDB(variant string) *leveldb.DB {
@@ -81,7 +81,7 @@ func (s *Store) pageReduceTotalCount(variant string) {
// PageTotal returns total amount of pages.
func (s *Store) PageTotal(variant string) int {
- return (int(s.pageGetTotalCount(variant)) / pageSize) + 1
+ return (int(s.pageGetTotalCount(variant)) / PageSize) + 1
}
// Page returns all entries in a page.
@@ -91,8 +91,8 @@ func (s *Store) Page(variant string, entry int) []string {
}
var page []string
- start := entry*pageSize + 1
- end := start + pageSize
+ start := entry*PageSize + 1
+ end := start + PageSize
begin := false
db := s.pageDB(variant)