services

package
v0.0.0-...-8699ab8 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDistance

func ComputeDistance(gem1, gem2 *models.Gem) float64

computes the euclidian distance between gems

func ComputeDistanceToList

func ComputeDistanceToList(gemReference *models.Gem, gems []models.Gem) []models.GemDistance

func ComputeDistanceWithSumerian

func ComputeDistanceWithSumerian(gem1, gem2 *models.Gem) float64

func ComputeGem

func ComputeGem(phrase string) *models.Gem

func GetNearestItemsToPhrase

func GetNearestItemsToPhrase(phrase string, limit int64, mongoDb *MongoDb) ([]models.GemDistance, error)

Types

type MongoDb

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

func NewMongoDb

func NewMongoDb(client *mongo.Client) *MongoDb

func (*MongoDb) Close

func (m *MongoDb) Close()

func (*MongoDb) EnsureMongoDbIsSetUp

func (m *MongoDb) EnsureMongoDbIsSetUp()

func (*MongoDb) GetCollection

func (m *MongoDb) GetCollection(collectionName string) *mongo.Collection

func (*MongoDb) GetGem

func (m *MongoDb) GetGem(phrase string) (*models.Gem, error)

func (*MongoDb) GetGems

func (m *MongoDb) GetGems(skip, limit int64) ([]models.Gem, error)

func (*MongoDb) InsertGem

func (m *MongoDb) InsertGem(gem *models.Gem) error

Jump to

Keyboard shortcuts

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