package
0.0.0-20210418013023-498cede6354f
Repository: https://github.com/ajithkumar-raj/go-learn.git
Documentation: pkg.go.dev

# README

SMTP

SMTP will send you a mail with Content-Type: text/plain.

Config

Create a config.go with fromAdd, password, and toAdd

// const.go
package main

// DBName Database name.
const DBName = "geolocation"

// Database collections.
var (
	PointCollection = "points"
	connString      = "mongodb+srv://<username>:<password>@cluster0-zzart.mongodb.net/test?retryWrites=true&w=majority"
)

# Functions

AddPoint adds a new point to the collection.
GetPointsByDistance gets all the points that are within the maximum distance provided in meters.
NewPoint returns a GeoJSON Point with longitude and latitude.

# Structs

Location is a GeoJSON type.
Point is a simple type with a location for geospatial queries.