interfaces

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: 4 Imported by: 2

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.

type ConfigurationManager

type ConfigurationManager struct {
	ConfigurationInteractor IConfiguration
}

ConfigurationManager : contains the configuration interactor.

func (ConfigurationManager) GetConfig

func (c ConfigurationManager) GetConfig(key string, defaultValue interface{}) interface{}

GetConfig allows to retrieve a configuration value for a given key. Implements function from IConfiguration interface

func (ConfigurationManager) GetConfigBool

func (c ConfigurationManager) GetConfigBool(key string, defaultValue bool) bool

GetConfigBool allows to retrieve a configuration Boolean for a given key. Implements function from IConfiguration interface

func (ConfigurationManager) GetConfigString

func (c ConfigurationManager) GetConfigString(key string, defaultValue string) string

GetConfigString allows to retrieve a configuration String for a given key. Implements function from IConfiguration interface

func (ConfigurationManager) GetConfigUInt

func (c ConfigurationManager) GetConfigUInt(key string, defaultValue uint) uint

GetConfigUInt allows to retrieve a configuration UInt for a given key. Implements function from IConfiguration interface

type IAppInteractor

type IAppInteractor interface {
	Search(query string) ([]domain.App, error)
	Get(id string) (domain.App, error)
	CreateBatch(newApps []domain.App) ([]string, error)
	Create(newApp domain.App) (string, error)
	Delete(id string) (string, error)
	DeleteBatch(ids []string) ([]string, error)
}

type IConfiguration

type IConfiguration interface {
	GetConfig(key string, defaultValue interface{}) interface{}
	GetConfigString(key string, defaultValue string) string
	GetConfigBool(key string, defaultValue bool) bool
	GetConfigUInt(key string, defaultValue uint) uint
}

IConfiguration : Configuration interface. Not to rely on a concrete configuration implementation.

type IWebservice

type IWebservice interface {
	Default(config ConfigurationManager, res http.ResponseWriter, req *http.Request)
	Get(config ConfigurationManager, res http.ResponseWriter, req *http.Request)
	Create(config ConfigurationManager, res http.ResponseWriter, req *http.Request)
	Delete(config ConfigurationManager, res http.ResponseWriter, req *http.Request)
}

Jump to

Keyboard shortcuts

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