ShardQuest

package
v0.0.0-...-5cd9a77 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: MIT Imports: 6 Imported by: 0

README

WIP

Collection of handy stuff to assist in Shardedmap

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Find

type Find struct {
	MaxWorkers int
	// contains filtered or unexported fields
}

func (*Find) AttachQuest

func (f *Find) AttachQuest(q *Quest)

func (*Find) FindFilterValues

func (f *Find) FindFilterValues(filterFunc func(string, interface{}) bool)

func (*Find) FindKeys

func (f *Find) FindKeys(rule string)

func (*Find) FindKeysContaining

func (f *Find) FindKeysContaining(rule string)

func (*Find) FindKeysFunc

func (f *Find) FindKeysFunc(fun func(string) bool)

func (*Find) FindValues

func (f *Find) FindValues(filterFunc func(interface{}) bool)

type Quest

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

func NewQuest

func NewQuest(i *Shardmap.ShardMap) *Quest

NewQuest initializes new shardmap quest! input: shardmap that you want to work on. Return: a Quest

func (*Quest) Delete

func (q *Quest) Delete()

Delete deletes entries matched with find from the actual asyncmap resourec

func (*Quest) FindFilterValues

func (q *Quest) FindFilterValues(filterFunc func(string, interface{}) bool) *Quest

func (*Quest) FindKeys

func (q *Quest) FindKeys(rule string) *Quest

FindKeys - similar what findvalues is, but accepts a regex string for finding keys.

func (*Quest) FindKeysContaining

func (q *Quest) FindKeysContaining(rule string) *Quest

FindKeysContaining - exactly what findkeys is, but uses string.contains, slightly faster.

func (*Quest) FindKeysFunc

func (q *Quest) FindKeysFunc(f func(string) bool) *Quest

FindKeysFunc - a custom function to do the string matching.

func (*Quest) FindValues

func (q *Quest) FindValues(filterFunc func(interface{}) bool) *Quest

FinValues - a filter function. Input: a function that accepts interface as argument, the interface is single entry stored in shardmaps shard.

func (*Quest) Reset

func (q *Quest) Reset()

func (*Quest) Results

func (q *Quest) Results() *map[string]*interface{}

Results: returns results.

func (*Quest) ResultsToShardedmap

func (q *Quest) ResultsToShardedmap(shards int) *Shardmap.ShardMap

ResultsToShardedmap - returns a new shardedmap from the results

func (*Quest) ToResults

func (q *Quest) ToResults(in *map[string]*interface{})

you can now run multiple finds() asonchronously on same quest input

Jump to

Keyboard shortcuts

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