Help us shape the future of Go! Take the 2026 Go Developer Survey

librakv

package module
v0.0.0-...-c3065eb Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 5 Imported by: 0

README

LibraDB

Build codecov Go Report Card GoDoc License

LibraKV is a Go-based key-value database.

Contents

Requirements

  • Go 1.22 or later

Installation

  1. Install Go and set your workspace

  2. Get the project

go -get https://github.com/Huangkai1008/librakv

Usage

1.Add the libs

go mod download       

2.Run the application

go run cmd/main.go

License

MIT @ Huang Kai

Documentation

Index

Constants

View Source
const (
	DefaultLogFileSize = 64 << 20 // 64MB
)
View Source
const (
	FileLockName = "libra.lock"
)

Variables

View Source
var (
	ErrNilOption            = errors.New("nil option provided")
	ErrLogFileThresholdSize = errors.New("log file threshold size cannot be 0")
)
View Source
var (
	ErrDatabaseIsRunning = errors.New("database is used by another process")
)

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func Open

func Open(dataDir string, opts ...Option) (*Database, error)

Open creates a new Database instance with dataDir and the specified options.

If the dataDir doesn't exist, it will be created automatically.

type Key

type Key []byte

type Option

type Option func(*Options) error

func WithLogFileThresholdSize

func WithLogFileThresholdSize(size uint) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options of the database.

func DefaultOptions

func DefaultOptions() *Options

func (*Options) Apply

func (o *Options) Apply(opts ...Option) error

Apply applies the given options to Options.

type Value

type Value []byte

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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