storage

package
v0.0.0-...-104bc2f Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyRecord

type DummyRecord struct {
	TypeTable string
}

DummyRecord - standard record (struct) for dummy storage package

func (*DummyRecord) Search

func (dummy *DummyRecord) Search(name string, query string) (map[string][]string, error)

Search data in the storage

func (*DummyRecord) SearchMultiple

func (dummy *DummyRecord) SearchMultiple(
	typeTable string, name string, query string) (map[string][]string, error)

SearchMultiple - search multiple records of data in the storage

func (*DummyRecord) SearchRelated

func (dummy *DummyRecord) SearchRelated(
	typeTable string, name string, query string) (map[string][]string, error)

SearchRelated - search data in the storage from related type or table

type ElasticsearchRecord

type ElasticsearchRecord struct {
	Host  string
	Port  int
	Index string
	Type  string
}

ElasticsearchRecord - standard record (struct) for elasticsearch storage package

func (*ElasticsearchRecord) Search

func (elastic *ElasticsearchRecord) Search(name string, query string) (map[string][]string, error)

Search data in the storage

func (*ElasticsearchRecord) SearchMultiple

func (elastic *ElasticsearchRecord) SearchMultiple(
	typeTable string, name string, query string) (map[string][]string, error)

SearchMultiple - search multiple records of data in the storage

func (*ElasticsearchRecord) SearchRelated

func (elastic *ElasticsearchRecord) SearchRelated(
	typeTable string, name string, query string) (map[string][]string, error)

SearchRelated - search data in the storage from related type or table

type MysqlRecord

type MysqlRecord struct {
	Host     string
	Port     int
	User     string
	Password string
	DataBase string
	Table    string
}

MysqlRecord - standard record (struct) for mysql storage package

func (*MysqlRecord) Search

func (mysql *MysqlRecord) Search(name string, query string) (map[string][]string, error)

Search data in the storage

func (*MysqlRecord) SearchMultiple

func (mysql *MysqlRecord) SearchMultiple(
	typeTable string, name string, query string) (map[string][]string, error)

SearchMultiple - search multiple records of data in the storage

func (*MysqlRecord) SearchRelated

func (mysql *MysqlRecord) SearchRelated(
	typeTable string, name string, query string) (map[string][]string, error)

SearchRelated - search data in the storage from related type or table

type Record

type Record struct {
	mapper.Bundle
	// contains filtered or unexported fields
}

Record - standard record (struct) for storage package

func New

func New(conf *config.Record, bundle mapper.Bundle) *Record

New - returns new Storage instance

func (*Record) Search

func (storage *Record) Search(query string) (answer string, ok bool)

Search and sort a data from the storage

type Storage

type Storage interface {
	Search(name string, query string) (map[string][]string, error)
	SearchRelated(typeTable string, name string, query string) (map[string][]string, error)
	SearchMultiple(typeTable string, name string, query string) (map[string][]string, error)
}

Storage - the interface for every implementation of storage

Jump to

Keyboard shortcuts

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