bolt

package
v0.0.0-...-8a4eff6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

func (*Driver) Close

func (d *Driver) Close() error

Close closes the underlying database.

func (*Driver) Open

func (d *Driver) Open(path string) error

Open opens the connection to the bolt database defined by path.

func (*Driver) ResetSequence

func (d *Driver) ResetSequence(maxID int) error

type PaperRepository

type PaperRepository struct {
	Driver *Driver
}

PaperRepository is used to store and retrieve papers from a bolt database.

func (*PaperRepository) Delete

func (s *PaperRepository) Delete(id int) error

func (*PaperRepository) Get

func (s *PaperRepository) Get(ids ...int) ([]papernet.Paper, error)

Get retrieves the paper defined by id in the database. If no paper can be found with the given id, Get returns nil.

func (*PaperRepository) List

func (s *PaperRepository) List() ([]papernet.Paper, error)

func (*PaperRepository) Upsert

func (s *PaperRepository) Upsert(paper *papernet.Paper) error

Upsert inserts or update a paper in the database, depending on paper.ID.

type TagIndex

type TagIndex struct {
	Driver *Driver
}

func (*TagIndex) Index

func (s *TagIndex) Index(tag string) error

func (*TagIndex) Search

func (s *TagIndex) Search(prefix string) ([]string, error)

Jump to

Keyboard shortcuts

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