leveldb

package
v0.1.4-0...-e21f60a Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2017 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const PREFUNC = "func:"

PREFUNC perfix func key

View Source
const PREJOB = "job:"

PREJOB prefix job key

View Source
const PRESEQUENCE = "sequence:"

PRESEQUENCE prefix sequence key

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	RWLocker *sync.Mutex
	// contains filtered or unexported fields
}

Driver define leveldb store driver

func NewDriver

func NewDriver(dbpath string) Driver

NewDriver create a leveldb store driver

func (Driver) Close

func (l Driver) Close() error

Close the driver

func (Driver) Delete

func (l Driver) Delete(jobID int64) (err error)

Delete a job with job id.

func (Driver) Get

func (l Driver) Get(jobID int64) (driver.Job, error)

Get a job with job id.

func (Driver) GetOne

func (l Driver) GetOne(Func, name string) (job driver.Job, err error)

GetOne get a job with func and name.

func (Driver) NewIterator

func (l Driver) NewIterator(Func []byte) driver.Iterator

NewIterator create a job Iterator with func or nil.

func (Driver) Save

func (l Driver) Save(job *driver.Job, force ...bool) (err error)

Save job. when job is exists update it, other create one.

type Iterator

type Iterator struct {
	Func []byte
	// contains filtered or unexported fields
}

Iterator define the job iterator

func (*Iterator) Close

func (iter *Iterator) Close()

Close the iterator

func (*Iterator) Error

func (iter *Iterator) Error() error

Error returns the current error.

func (*Iterator) Next

func (iter *Iterator) Next() bool

Next advances the iterator to the next value, which will then be available through then the Value method. It returns false if no further advancement is possible.

func (*Iterator) Value

func (iter *Iterator) Value() (job driver.Job)

Value returns the current job.

Jump to

Keyboard shortcuts

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