Documentation ¶
Index ¶
- func ComputeDistance(gem1, gem2 *models.Gem) float64
- func ComputeDistanceToList(gemReference *models.Gem, gems []models.Gem) []models.GemDistance
- func ComputeDistanceWithSumerian(gem1, gem2 *models.Gem) float64
- func ComputeGem(phrase string) *models.Gem
- func GetNearestItemsToPhrase(phrase string, limit int64, mongoDb *MongoDb) ([]models.GemDistance, error)
- type MongoDb
- func (m *MongoDb) Close()
- func (m *MongoDb) EnsureMongoDbIsSetUp()
- func (m *MongoDb) GetCollection(collectionName string) *mongo.Collection
- func (m *MongoDb) GetGem(phrase string) (*models.Gem, error)
- func (m *MongoDb) GetGems(skip, limit int64) ([]models.Gem, error)
- func (m *MongoDb) InsertGem(gem *models.Gem) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeDistance ¶
computes the euclidian distance between gems
func ComputeDistanceToList ¶
func ComputeGem ¶
func GetNearestItemsToPhrase ¶
Types ¶
type MongoDb ¶
type MongoDb struct {
// contains filtered or unexported fields
}
func NewMongoDb ¶
func (*MongoDb) EnsureMongoDbIsSetUp ¶
func (m *MongoDb) EnsureMongoDbIsSetUp()
func (*MongoDb) GetCollection ¶
func (m *MongoDb) GetCollection(collectionName string) *mongo.Collection
Click to show internal directories.
Click to hide internal directories.