repositories

package
v0.0.0-...-2f731f1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgoliaRepository

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

AlgoliaRepository allows to interact with Algolia backend.

func NewAlgoliaRepository

func NewAlgoliaRepository(applicationID string, apiKey string, repository string) *AlgoliaRepository

NewAlgoliaRepository creates a new AlgoliaRepository object.

func (*AlgoliaRepository) AppToObject

func (ar *AlgoliaRepository) AppToObject(app domain.App) (algoliasearch.Object, error)

AppToObject allows to convert a domain.App object to an Algolia Object.

func (*AlgoliaRepository) AppsToObjects

func (ar *AlgoliaRepository) AppsToObjects(app []domain.App) ([]algoliasearch.Object, error)

AppsToObjects allows to convert multiple domain.App objects to Algolia Objects.

func (*AlgoliaRepository) Create

func (ar *AlgoliaRepository) Create(newApp domain.App) (string, error)

Create allows to add app into the app index. Returns the id of added app or an error. Implements IRepository interface.

func (*AlgoliaRepository) CreateBatch

func (ar *AlgoliaRepository) CreateBatch(newApps []domain.App) ([]string, error)

CreateBatch allows to add apps into the app index. Returns the ids of added apps or an error. Implements IRepository interface.

func (*AlgoliaRepository) Delete

func (ar *AlgoliaRepository) Delete(id string) (string, error)

Delete allows to delete an app from the app index. Returns the id of deleted app or an error. Implements IRepository interface.

func (*AlgoliaRepository) DeleteBatch

func (ar *AlgoliaRepository) DeleteBatch(ids []string) ([]string, error)

Delete allows to delete multiple apps from the app index. Returns the ids of deleted apps or an error. Implements IRepository interface.

func (*AlgoliaRepository) Get

func (ar *AlgoliaRepository) Get(id string) (domain.App, error)

Get allows to search an app in the app index. Returns the matching App Object or an error. Implements IRepository interface.

func (*AlgoliaRepository) HitToApp

func (ar *AlgoliaRepository) HitToApp(object algoliasearch.Map) (domain.App, error)

ObjectToApp allows to convert a Algolia Map object to an domain.App.

func (*AlgoliaRepository) HitsToApps

func (ar *AlgoliaRepository) HitsToApps(object []algoliasearch.Map) ([]domain.App, error)

ObjectsToApps allows to convert multiple Algolia Maps to domain.App objects.

func (*AlgoliaRepository) ObjectToApp

func (ar *AlgoliaRepository) ObjectToApp(object algoliasearch.Object) (domain.App, error)

ObjectToApp allows to convert a Algolia Object to an domain.App.

func (*AlgoliaRepository) Search

func (ar *AlgoliaRepository) Search(query string) ([]domain.App, error)

Search allows to search apps in the app index. Returns a list of Apps Objects or an error. Implements IRepository interface.

Jump to

Keyboard shortcuts

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