consumertest

package
v2.0.212+incompatible Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shard

type Shard struct {
	IDFixture        consumer.ShardID
	PartitionFixture topic.Partition
	// contains filtered or unexported fields
}

Test type which conforms to consumer.Shard, and manages setup & teardown of a test RocksDB instance.

func NewShard

func NewShard(prefix string) (*Shard, error)

Initializes a Shard & database backed by a temporary directory. TODO(johnny): Since this is test support, panic on error (rather than returning it).

func (*Shard) Cache

func (s *Shard) Cache() interface{}

func (*Shard) Close

func (s *Shard) Close() error

Closes and removes the Shard database.

func (*Shard) Database

func (s *Shard) Database() *rocks.DB

func (*Shard) DatabaseContent

func (s *Shard) DatabaseContent() map[string]string

DatabaseContents enumerates and returns keys and values from the database as a map. As this is a test support method, it panics on iterator error.

func (*Shard) FlushTransaction

func (s *Shard) FlushTransaction() error

Flushes the current Shard transaction WriteBatch to the database.

func (*Shard) ID

func (s *Shard) ID() consumer.ShardID

consumer.Shard implementation.

func (*Shard) Partition

func (s *Shard) Partition() topic.Partition

func (*Shard) ReadOptions

func (s *Shard) ReadOptions() *rocks.ReadOptions

func (*Shard) SetCache

func (s *Shard) SetCache(c interface{})

func (*Shard) Transaction

func (s *Shard) Transaction() *rocks.WriteBatch

func (*Shard) WriteOptions

func (s *Shard) WriteOptions() *rocks.WriteOptions

Jump to

Keyboard shortcuts

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