gocask

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 5 Imported by: 0

README

GoCask

Go Coverage Status Go Report Card Go Reference

Go implementation of Bitcask - A Log-Structured Hash Table for Fast Key / Value Data

Documentation

Index

Constants

View Source
const (
	// KB represents base2 kilobyte
	KB int64 = 1024

	// MB represents base2 megabyte
	MB = KB * 1024

	// GB represents base2 gigabyte
	GB = MB * 1024

	// TB represents base2 terabyte
	TB = GB * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*cask.DB
}

DB represents gocask A Log-Structured Hash Table for Fast Key/Value Data Based on https://riak.com/assets/bitcask-intro.pdf

func Open

func Open(dbPath string, opts ...Option) (*DB, error)

Open opens an existing database at dbPath or creates a new one The database location can be configured with config options and the default is ~/gcdata Magic in:mem:db value for dbPath can be used in order to instantiate an in memory file system which can be used for testing purposes

type Option

type Option func(config cask.Config) cask.Config

Option represents gocask configuration option

func WithDataDir

func WithDataDir(path string) Option

WithDataDir configures the location of the data dir where your databases will reside

func WithMaxDataFileSize

func WithMaxDataFileSize(bytes int64) Option

WithMaxDataFileSize configures maximum data file size after which data files will be rotated

Directories

Path Synopsis
cmd
internal
crc
fs
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL