db

package
v0.0.0-...-a1302ff Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package db implements a Truffle database.

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
}

func New

func New(ctx context.Context, config *cpb.Config, db *dpb.Database) *DB

func (*DB) Delete

func (db *DB) Delete(ctx context.Context, header source.H) error

func (*DB) DeleteNode

func (db *DB) DeleteNode(ctx context.Context, header node.H) error

func (*DB) Get

func (db *DB) Get(ctx context.Context, header source.H, refresh option.Remote) (source.S, error)

func (*DB) GetNode

func (db *DB) GetNode(ctx context.Context, header node.H, refresh option.Remote) (node.N, error)

func (*DB) PB

func (db *DB) PB() *dpb.Database

func (*DB) Put

func (db *DB) Put(ctx context.Context, s source.S) (source.H, error)

Put saves a source into the Truffle DB.

  1. If the source does not exist, save it.
  2. If the source does not specify a node ID, generate one.
  3. If the source specifies a node ID different from its current designation, attempt to link the new ID.

func (*DB) Search

func (db *DB) Search(ctx context.Context, query string, opts map[epb.SourceAPI][]option.O) ([]source.S, error)

Jump to

Keyboard shortcuts

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