database

package
v0.0.0-...-f148425 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2016 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBDatabase

type LevelDBDatabase struct {
	dictd.Database
	// contains filtered or unexported fields
}

LevelDB Database container. This contains some fun bits (like the * leveldb.DB object, and the description the user gave us over in * NewLevelDBDatabase.

func NewLevelDBDatabase

func NewLevelDBDatabase(path string, description string) (*LevelDBDatabase, error)

Create a new LevelDB Database. `path` should be the full filesystem path * to the leveldb database, and `description` should be what we tell the user * the database is when they ask about it. Something short, for `SHOW DB`.

func (*LevelDBDatabase) Define

func (this *LevelDBDatabase) Define(name string, query string) []*dictd.Definition

Handle incoming `DEFINE` calls.

func (*LevelDBDatabase) Description

func (this *LevelDBDatabase) Description(name string) string

Handle the short description of what this database does (for * inline `SHOW DB` output)

func (*LevelDBDatabase) Info

func (this *LevelDBDatabase) Info(name string) string

Handle the information call (SHOW INFO `name`) for this database.

func (*LevelDBDatabase) Match

func (this *LevelDBDatabase) Match(name string, query string, strat string) (defs []*dictd.Definition)

Handle incoming RFC2229 MATCH requests. * * Currently supported MATCH algorithms: * * [default] - Metaphone * - Prefix (byte prefixes) * - Soundex * - Levenshtein

func (*LevelDBDatabase) Strategies

func (this *LevelDBDatabase) Strategies(name string) map[string]string

Get all valid Strategies

func (*LevelDBDatabase) WriteDefinition

func (this *LevelDBDatabase) WriteDefinition(word string, definition string)

* Given a word `word`, defined by definition `definition`, write this out * to the LevelDB database, and generate all Indexes we need. *

type UrbanDictionaryDatabase

type UrbanDictionaryDatabase struct {
	dictd.Database
}

*

func (*UrbanDictionaryDatabase) Define

func (this *UrbanDictionaryDatabase) Define(name string, query string) (definitions []*dictd.Definition)

*

func (*UrbanDictionaryDatabase) Description

func (this *UrbanDictionaryDatabase) Description(name string) string

*

func (*UrbanDictionaryDatabase) Info

func (this *UrbanDictionaryDatabase) Info(name string) string

*

func (*UrbanDictionaryDatabase) Match

func (this *UrbanDictionaryDatabase) Match(name string, query string, strat string) []*dictd.Definition

*

func (*UrbanDictionaryDatabase) Strategies

func (this *UrbanDictionaryDatabase) Strategies(name string) map[string]string

*

Jump to

Keyboard shortcuts

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