db

package
v0.0.0-...-8742a2b Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package db implements a simple key-value database. The database is cached in memory and mirrored on disk. It is used to store corpus in syz-manager and syz-hub. The database strives to minimize number of disk accesses as they can be slow in virtualized environments (GCE).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(filename string, version uint64, records []Record) error

Create creates a new database in the specified file with the specified records.

func ReadCorpus

func ReadCorpus(filename string, target *prog.Target) (progs []*prog.Prog, err error)

Types

type DB

type DB struct {
	Version uint64            // arbitrary user version (0 for new database)
	Records map[string]Record // in-memory cache, must not be modified directly
	// contains filtered or unexported fields
}

func Open

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

func (*DB) BumpVersion

func (db *DB) BumpVersion(version uint64) error

func (*DB) Delete

func (db *DB) Delete(key string)

func (*DB) Flush

func (db *DB) Flush() error

func (*DB) Save

func (db *DB) Save(key string, val []byte, seq uint64)

type Record

type Record struct {
	Val []byte
	Seq uint64
}

Jump to

Keyboard shortcuts

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