search

package
v0.0.0-...-ccf9113 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func InsertBook

func InsertBook(ctx context.Context, book schema.Book) error

func SearchBooks

func SearchBooks(ctx context.Context, query string, skip uint64, take uint64) ([]schema.Book, error)

func SetRepository

func SetRepository(repo Repository)

Types

type ElasticRepository

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

func NewElastic

func NewElastic(url string) (*ElasticRepository, error)

func (*ElasticRepository) Close

func (e *ElasticRepository) Close()

func (*ElasticRepository) InsertBook

func (e *ElasticRepository) InsertBook(ctx context.Context, book schema.Book) error

func (*ElasticRepository) SearchBooks

func (e *ElasticRepository) SearchBooks(ctx context.Context, query string, skip uint64, take uint64) ([]schema.Book, error)

type Repository

type Repository interface {
	Close()
	InsertBook(ctx context.Context, book schema.Book) error
	SearchBooks(ctx context.Context, query string, skip uint64, take uint64) ([]schema.Book, error)
}

Jump to

Keyboard shortcuts

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