Switch import path to hak5 fork

master v1.3.1-hak5
Marc 2022-02-18 16:07:03 +00:00
parent 1bc3b1f90e
commit 107dea6e7a
No known key found for this signature in database
GPG Key ID: 0657563F705ACAAE
14 changed files with 32 additions and 25 deletions

View File

@ -9,7 +9,7 @@ race:
# go get github.com/kisielk/errcheck # go get github.com/kisielk/errcheck
errcheck: errcheck:
@errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt @errcheck -ignorepkg=bytes -ignore=os:Remove github.com/hak5/bolt
test: test:
@go test -v -cover . @go test -v -cover .

View File

@ -1,4 +1,4 @@
Bolt [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.svg)](https://godoc.org/github.com/boltdb/bolt) ![Version](https://img.shields.io/badge/version-1.2.1-green.svg) Bolt [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/hak5/bolt?status.svg)](https://godoc.org/github.com/hak5/bolt) ![Version](https://img.shields.io/badge/version-1.2.1-green.svg)
==== ====
Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas] Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas]
@ -78,7 +78,7 @@ Shopify and Heroku use Bolt-backed services every day.
To start using Bolt, install Go and run `go get`: To start using Bolt, install Go and run `go get`:
```sh ```sh
$ go get github.com/boltdb/bolt/... $ go get github.com/hak5/bolt/...
``` ```
This will retrieve the library and install the `bolt` command line utility into This will retrieve the library and install the `bolt` command line utility into
@ -98,7 +98,7 @@ package main
import ( import (
"log" "log"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
func main() { func main() {
@ -541,7 +541,7 @@ this from a read-only transaction, it will perform a hot backup and not block
your other database reads and writes. your other database reads and writes.
By default, it will use a regular file handle which will utilize the operating By default, it will use a regular file handle which will utilize the operating
system's page cache. See the [`Tx`](https://godoc.org/github.com/boltdb/bolt#Tx) system's page cache. See the [`Tx`](https://godoc.org/github.com/hak5/bolt#Tx)
documentation for information about optimizing for larger-than-RAM datasets. documentation for information about optimizing for larger-than-RAM datasets.
One common use case is to backup over HTTP so you can use tools like `cURL` to One common use case is to backup over HTTP so you can use tools like `cURL` to
@ -825,7 +825,7 @@ Here are a few things to note when evaluating and using Bolt:
For more information on page allocation, [see this comment][page-allocation]. For more information on page allocation, [see this comment][page-allocation].
[page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638 [page-allocation]: https://github.com/hak5/bolt/issues/308#issuecomment-74811638
## Reading the Source ## Reading the Source

View File

@ -13,7 +13,7 @@ import (
"testing" "testing"
"testing/quick" "testing/quick"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
// Ensure that a bucket that gets a non-existent key returns nil. // Ensure that a bucket that gets a non-existent key returns nil.
@ -83,7 +83,7 @@ func TestBucket_Get_IncompatibleValue(t *testing.T) {
// Ensure that a slice returned from a bucket has a capacity equal to its length. // Ensure that a slice returned from a bucket has a capacity equal to its length.
// This also allows slices to be appended to since it will require a realloc by Go. // This also allows slices to be appended to since it will require a realloc by Go.
// //
// https://github.com/boltdb/bolt/issues/544 // https://github.com/hak5/bolt/issues/544
func TestBucket_Get_Capacity(t *testing.T) { func TestBucket_Get_Capacity(t *testing.T) {
db := MustOpenDB() db := MustOpenDB()
defer db.MustClose() defer db.MustClose()
@ -867,7 +867,7 @@ func TestBucket_NextSequence(t *testing.T) {
// Ensure that a bucket will persist an autoincrementing sequence even if its // Ensure that a bucket will persist an autoincrementing sequence even if its
// the only thing updated on the bucket. // the only thing updated on the bucket.
// https://github.com/boltdb/bolt/issues/296 // https://github.com/hak5/bolt/issues/296
func TestBucket_NextSequence_Persist(t *testing.T) { func TestBucket_NextSequence_Persist(t *testing.T) {
db := MustOpenDB() db := MustOpenDB()
defer db.MustClose() defer db.MustClose()

View File

@ -19,7 +19,7 @@ import (
"unicode/utf8" "unicode/utf8"
"unsafe" "unsafe"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
var ( var (
@ -875,7 +875,7 @@ The following errors can be reported:
No errors should occur in your database. However, if for some reason you No errors should occur in your database. However, if for some reason you
experience corruption, please submit a ticket to the Bolt project page: experience corruption, please submit a ticket to the Bolt project page:
https://github.com/boltdb/bolt/issues https://github.com/hak5/bolt/issues
`, "\n") `, "\n")
} }

View File

@ -12,8 +12,8 @@ import (
"strconv" "strconv"
"testing" "testing"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
"github.com/boltdb/bolt/cmd/bolt" "github.com/hak5/bolt/cmd/bolt"
) )
// Ensure the "info" command can print information about a database. // Ensure the "info" command can print information about a database.

View File

@ -36,7 +36,7 @@ func (c *Cursor) First() (key []byte, value []byte) {
c.first() c.first()
// If we land on an empty page then move to the next value. // If we land on an empty page then move to the next value.
// https://github.com/boltdb/bolt/issues/450 // https://github.com/hak5/bolt/issues/450
if c.stack[len(c.stack)-1].count() == 0 { if c.stack[len(c.stack)-1].count() == 0 {
c.next() c.next()
} }
@ -240,7 +240,7 @@ func (c *Cursor) next() (key []byte, value []byte, flags uint32) {
c.first() c.first()
// If this is an empty page then restart and move back up the stack. // If this is an empty page then restart and move back up the stack.
// https://github.com/boltdb/bolt/issues/450 // https://github.com/hak5/bolt/issues/450
if c.stack[len(c.stack)-1].count() == 0 { if c.stack[len(c.stack)-1].count() == 0 {
continue continue
} }

View File

@ -11,7 +11,7 @@ import (
"testing" "testing"
"testing/quick" "testing/quick"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
// Ensure that a cursor can return a reference to the bucket that created it. // Ensure that a cursor can return a reference to the bucket that created it.
@ -165,7 +165,7 @@ func TestCursor_Delete(t *testing.T) {
// large number of keys. This test also checks that seek will always move // large number of keys. This test also checks that seek will always move
// forward to the next key. // forward to the next key.
// //
// Related: https://github.com/boltdb/bolt/pull/187 // Related: https://github.com/hak5/bolt/pull/187
func TestCursor_Seek_Large(t *testing.T) { func TestCursor_Seek_Large(t *testing.T) {
db := MustOpenDB() db := MustOpenDB()
defer db.MustClose() defer db.MustClose()

4
db.go
View File

@ -66,7 +66,7 @@ type DB struct {
// Skipping truncation avoids preallocation of hard drive space and // Skipping truncation avoids preallocation of hard drive space and
// bypasses a truncate() and fsync() syscall on remapping. // bypasses a truncate() and fsync() syscall on remapping.
// //
// https://github.com/boltdb/bolt/issues/284 // https://github.com/hak5/bolt/issues/284
NoGrowSync bool NoGrowSync bool
// If you want to read the entire database fast, you can set MmapFlag to // If you want to read the entire database fast, you can set MmapFlag to
@ -871,7 +871,7 @@ func (db *DB) grow(sz int) error {
} }
// Truncate and fsync to ensure file size metadata is flushed. // Truncate and fsync to ensure file size metadata is flushed.
// https://github.com/boltdb/bolt/issues/284 // https://github.com/hak5/bolt/issues/284
if !db.NoGrowSync && !db.readOnly { if !db.NoGrowSync && !db.readOnly {
if runtime.GOOS != "windows" { if runtime.GOOS != "windows" {
if err := db.file.Truncate(int64(sz)); err != nil { if err := db.file.Truncate(int64(sz)); err != nil {

View File

@ -19,7 +19,7 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
var statsFlag = flag.Bool("stats", false, "show performance stats") var statsFlag = flag.Bool("stats", false, "show performance stats")
@ -180,7 +180,7 @@ func TestOpen_ErrChecksum(t *testing.T) {
} }
// Ensure that opening a database does not increase its size. // Ensure that opening a database does not increase its size.
// https://github.com/boltdb/bolt/issues/291 // https://github.com/hak5/bolt/issues/291
func TestOpen_Size(t *testing.T) { func TestOpen_Size(t *testing.T) {
// Open a data file. // Open a data file.
db := MustOpenDB() db := MustOpenDB()
@ -240,7 +240,7 @@ func TestOpen_Size(t *testing.T) {
} }
// Ensure that opening a database beyond the max step size does not increase its size. // Ensure that opening a database beyond the max step size does not increase its size.
// https://github.com/boltdb/bolt/issues/303 // https://github.com/hak5/bolt/issues/303
func TestOpen_Size_Large(t *testing.T) { func TestOpen_Size_Large(t *testing.T) {
if testing.Short() { if testing.Short() {
t.Skip("short mode") t.Skip("short mode")

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module github.com/hak5/bolt
go 1.17
require golang.org/x/sys v0.0.0-20220209214540-3681064d5158

2
go.sum Normal file
View File

@ -0,0 +1,2 @@
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View File

@ -229,7 +229,7 @@ func (n *node) write(p *page) {
// If the length of key+value is larger than the max allocation size // If the length of key+value is larger than the max allocation size
// then we need to reallocate the byte array pointer. // then we need to reallocate the byte array pointer.
// //
// See: https://github.com/boltdb/bolt/pull/335 // See: https://github.com/hak5/bolt/pull/335
klen, vlen := len(item.key), len(item.value) klen, vlen := len(item.key), len(item.value)
if len(b) < klen+vlen { if len(b) < klen+vlen {
b = (*[maxAllocSize]byte)(unsafe.Pointer(&b[0]))[:] b = (*[maxAllocSize]byte)(unsafe.Pointer(&b[0]))[:]

View File

@ -7,7 +7,7 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
func TestSimulate_1op_1p(t *testing.T) { testSimulate(t, 1, 1) } func TestSimulate_1op_1p(t *testing.T) { testSimulate(t, 1, 1) }

View File

@ -8,7 +8,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/boltdb/bolt" "github.com/hak5/bolt"
) )
// Ensure that committing a closed transaction returns an error. // Ensure that committing a closed transaction returns an error.