localdb

package
v0.0.0-...-4c91ef0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package localdb implements a diviner database on the local file system using boltdb.

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 implements diviner.Database using Bolt.

func Open

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

Open opens and returns a new database with the provided filename. The file is created if it does not already exist.

func (*DB) AppendRunMetrics

func (d *DB) AppendRunMetrics(ctx context.Context, study string, seq uint64, metrics diviner.Metrics) error

func (*DB) CreateStudyIfNotExist

func (d *DB) CreateStudyIfNotExist(ctx context.Context, study diviner.Study) (created bool, err error)

func (*DB) CreateTable

func (*DB) CreateTable(_ context.Context) error

CreateTable is a no-op.

func (*DB) InsertRun

func (d *DB) InsertRun(ctx context.Context, run diviner.Run) (diviner.Run, error)

New implements diviner.Database.

func (*DB) ListRuns

func (d *DB) ListRuns(ctx context.Context, study string, states diviner.RunState, since time.Time) (runs []diviner.Run, err error)

Runs implements diviner.Database.

func (*DB) ListStudies

func (d *DB) ListStudies(ctx context.Context, prefix string, since time.Time) (studies []diviner.Study, err error)

Studies implements diviner.Database.

func (*DB) Log

func (d *DB) Log(study string, seq uint64, since time.Time, follow bool) io.Reader

Log implements diviner.Run.

func (*DB) Logger

func (d *DB) Logger(study string, seq uint64) io.WriteCloser

func (*DB) LookupRun

func (d *DB) LookupRun(ctx context.Context, study string, seq uint64) (run diviner.Run, err error)

Run implements diviner.Database.

func (*DB) LookupStudy

func (d *DB) LookupStudy(ctx context.Context, name string) (study diviner.Study, err error)

Study implements diviner.Database.

func (*DB) NextSeq

func (d *DB) NextSeq(ctx context.Context, study string) (seq uint64, err error)

NextSeq reserves and returns the next sequence number for the provided study.

func (*DB) UpdateRun

func (d *DB) UpdateRun(ctx context.Context, study string, seq uint64, state diviner.RunState, message string, runtime time.Duration, retry int) error

Jump to

Keyboard shortcuts

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