storage

package
v0.0.0-...-955e833 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB() *sql.DB

ConnectDB opens a connection to the database

func ConnectNeo

func ConnectNeo(cfg config.AppConfig) (neo4j.Driver, error)

ConnectNeo opens a connection to the database

Types

type Elastic

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

func ConnectElastic

func ConnectElastic(conf config.ElasticConf, logger *logging.Logger) (*Elastic, error)

func (*Elastic) AddRecipe

func (es *Elastic) AddRecipe(ctx context.Context, recipe api.Recipe) (string, error)

AddRecipe in elasticsearch return id of new document

func (*Elastic) DeleteRecipe

func (es *Elastic) DeleteRecipe(id string) error

func (*Elastic) GetRecipeById

func (es *Elastic) GetRecipeById(id string) (map[string]interface{}, error)

func (*Elastic) RecipeAll

func (es *Elastic) RecipeAll() ([]map[string]interface{}, error)

func (*Elastic) RecipeWithIngredient

func (es *Elastic) RecipeWithIngredient(value []string) ([]map[string]interface{}, error)

RecipeWithIngredient return the title

func (*Elastic) UpdateRecipe

func (es *Elastic) UpdateRecipe(ctx context.Context, recipe map[string]interface{}, id string) error

Jump to

Keyboard shortcuts

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