badgerdb

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package badgerdb is the BadgerDB embedded key-value plugin. Scripts import it as scriptling.badger:

import scriptling.badger as badger
db = badgerdb.open("/var/data/state")
db.set("greeting", "hello", ttl_seconds=60)
print(db.get("greeting"))
db.close()

The API mirrors the valkey plugin exactly, so scripts move between a shared cache and local storage unchanged. The directory must fall inside the host's allowed paths. The same library serves external plugin mode (plugins/badgerdb/cmd) and compiled-in registration (build tag plugin_badgerdb).

Badger allows a single process to open a database; opening the same directory twice fails on its lock file, by design.

Index

Constants

View Source
const Description = "BadgerDB embedded key-value store"

Description is the plugin metadata description.

View Source
const OpenSource = `def open(path):
    return Client(path)
`

OpenSource is the scriptling-source wrapper for open() in external plugin mode, where a Go function cannot return an instance over the wire: it constructs the Client class through the plugin object protocol.

Variables

This section is empty.

Functions

func Build

func Build(policy plugin.PolicySource) *object.Library

Build returns the scriptling.badger library. policy is read at call time so an external plugin sees the policy its handshake delivered.

Types

This section is empty.

Directories

Path Synopsis
Command badgerdb serves the BadgerDB plugin over the Scriptling plugin protocol (stdio JSON-RPC).
Command badgerdb serves the BadgerDB plugin over the Scriptling plugin protocol (stdio JSON-RPC).

Jump to

Keyboard shortcuts

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