localdb

package
v0.0.0-...-6d4bf48 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package localdb provides an interface for storing local data. Data stored in localdb is not synchronized to any other cored processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB provides access to a kv store. It is safe to access this database concurrently.

func Open

func Open(dataDir string) (*DB, error)

Open opens a new localDB, using the provided dataDir as the data directory for RocksDB.

func (*DB) Close

func (db *DB) Close()

Close closes the database. The database must be opened again before it will accept reads or writes.

func (*DB) Get

func (db *DB) Get(key string, v proto.Message) error

Get fetches the data associated with the provided key and unmarshals it into the provided protocol buffer.

func (*DB) Put

func (db *DB) Put(key string, value proto.Message) error

Put writes protocol buffer values to the database, at the provided key.

Directories

Path Synopsis
internal
localdbtest
Package localdbtest is a generated protocol buffer package.
Package localdbtest is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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