utils

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterID

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

func NewCounterID

func NewCounterID() *CounterID

func (*CounterID) Clone

func (c *CounterID) Clone() map[string]uint64

func (*CounterID) Inc

func (c *CounterID) Inc(v string)

type Iterator

type Iterator struct{ Err error }

Iterator does nothing

func (*Iterator) Error

func (it *Iterator) Error() error

Error returns any errors

func (*Iterator) Key

func (*Iterator) Key() []byte

Key returns nil

func (*Iterator) Next

func (*Iterator) Next() bool

Next returns false

func (*Iterator) Release

func (*Iterator) Release()

Release does nothing

func (*Iterator) Value

func (*Iterator) Value() []byte

Value returns nil

type NoopBatch

type NoopBatch struct{}

NoopBatch does nothing

func (*NoopBatch) Delete

func (*NoopBatch) Delete([]byte) error

Delete returns nil

func (*NoopBatch) Inner

func (b *NoopBatch) Inner() database.Batch

Inner returns itself

func (*NoopBatch) Put

func (*NoopBatch) Put(_, _ []byte) error

Put returns nil

func (*NoopBatch) Replay

Replay does nothing

func (*NoopBatch) Reset

func (*NoopBatch) Reset()

Reset does nothing

func (*NoopBatch) ValueSize

func (*NoopBatch) ValueSize() int

ValueSize returns 0

func (*NoopBatch) Write

func (*NoopBatch) Write() error

Write returns nil

type NoopDatabase

type NoopDatabase struct{}

NoopDatabase is a lightning fast key value store with probabilistic operations.

func (*NoopDatabase) Close

func (*NoopDatabase) Close() error

Close returns nil

func (*NoopDatabase) Compact

func (*NoopDatabase) Compact(_, _ []byte) error

Compact returns nil

func (*NoopDatabase) Delete

func (*NoopDatabase) Delete([]byte) error

Delete returns nil

func (*NoopDatabase) Get

func (*NoopDatabase) Get([]byte) ([]byte, error)

Get returns nil, error

func (*NoopDatabase) Has

func (*NoopDatabase) Has([]byte) (bool, error)

Has returns false, nil

func (*NoopDatabase) NewBatch

func (*NoopDatabase) NewBatch() database.Batch

NewBatch returns a new batch

func (*NoopDatabase) NewIterator

func (*NoopDatabase) NewIterator() database.Iterator

NewIterator returns a new empty iterator

func (*NoopDatabase) NewIteratorWithPrefix

func (*NoopDatabase) NewIteratorWithPrefix([]byte) database.Iterator

NewIteratorWithPrefix returns a new empty iterator

func (*NoopDatabase) NewIteratorWithStart

func (*NoopDatabase) NewIteratorWithStart([]byte) database.Iterator

NewIteratorWithStart returns a new empty iterator

func (*NoopDatabase) NewIteratorWithStartAndPrefix

func (db *NoopDatabase) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator

NewIteratorWithStartAndPrefix returns a new empty iterator

func (*NoopDatabase) Put

func (*NoopDatabase) Put(_, _ []byte) error

Put returns nil

func (*NoopDatabase) Stat

func (*NoopDatabase) Stat(string) (string, error)

Stat returns an error

type UniqueID

type UniqueID interface {
	Get(id string) (bool, error)
	Put(id string) error
}

func NewMemoryUniqueID

func NewMemoryUniqueID() UniqueID

type Worker

type Worker interface {
	Enque(job interface{})
	Finish(sleepTime time.Duration)
	JobCnt() int64
	IsFinished() bool
}

func NewWorker

func NewWorker(queueSize int, queueCnt int, processor func(int, interface{})) Worker

Jump to

Keyboard shortcuts

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