Documentation ¶
Index ¶
- Variables
- func FromDB(name string, db *bolt.DB) *implBoltStore
- func New(name string, dataFile string, dataFilePerm os.FileMode, options ...Option) (*implBoltStore, error)
- func ObjectType() reflect.Type
- func OpenDatabase(dataFile string, dataFilePerm os.FileMode, options ...Option) (*bolt.DB, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( BucketSeparator = byte(':') ErrDatabaseReadOnly = errors.New("readonly") ErrInvalidSeek = errors.New("invalid seek") ErrCanceled = errors.New("operation was canceled") )
var BoltStoreClass = reflect.TypeOf((*implBoltStore)(nil))
Functions ¶
func ObjectType ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures bolt using the functional options paradigm popularized by Rob Pike and Dave Cheney. If you're unfamiliar with this style, see https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html and https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis.
func WithIndefinitelyTimeout ¶
func WithInitialMmapSize ¶
InitialMmapSize is the initial mmap size of the database in bytes. Read transactions won't block write transaction if the InitialMmapSize is large enough to hold database mmap size. (See DB.Begin for more information)
If <=0, the initial map size is 0. If initialMmapSize is smaller than the previous database size, it takes no effect.
func WithMmapFlags ¶
Sets the DB.MmapFlags flag before memory mapping the file.
func WithNoGrowSync ¶
func WithNoGrowSync() Option
Sets the DB.NoGrowSync flag before memory mapping the file.
func WithReadOnly ¶
func WithReadOnly() Option
Open database in read-only mode. Uses flock(..., LOCK_SH |LOCK_NB) to grab a shared lock (UNIX).
func WithTimeout ¶
Timeout is the amount of time to wait to obtain a file lock. When set to zero it will wait indefinitely. This option is only available on Darwin and Linux.