Documentation ¶
Index ¶
- Variables
- func AddPolygon(compressed_polygon_list []string, addedBy, addedTime string, isInDanger bool) error
- func FileNameAnalyzer(filename string) (bool, string)
- func GeoCodeQuery(latitude, longitude string) (string, int, error)
- func GetTime() string
- func InitializeLogger()
- func LogError(err error)
- func RandomIDGenerator() string
- func SetupApi() *gin.Engine
- type AddPolygon_RequestPayload
- type Config
- type Configuration
- type Coordinates
- type Database
- type DatabaseManagement
- type ImageUpload
- type ImageUploadWithID
- type Locations
- type TimeStr
- type User
- type UserID
- type Username
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddPolygon ¶
func FileNameAnalyzer ¶
func InitializeLogger ¶
func InitializeLogger()
func RandomIDGenerator ¶
func RandomIDGenerator() string
Types ¶
type Config ¶
type Config struct { // Port number of server. Port uint16 // All APIs authorization keys for 3rd party microservices. ApiKeys map[string]string }
func (Config) GetApiKeys ¶
func (Config) LoggingPort ¶
func (c Config) LoggingPort()
func (*Config) SetApiKeys ¶
type Configuration ¶
type Configuration interface { // constructor NewConfig() Config // @getter: Config.Port GetPort() uint16 // @setter: Config.Port SetPort(port uint16) // @logger: Config.Port LogginPort() // @setter: ApiKeys (from .env file in the root of the project: server folder directory). SetApiKeys() // @getter: ApiKeys (from .env file in the root of the project: server folder directory). GetApiKeys(key string) string }
type Coordinates ¶
type Coordinates []float64
type Database ¶
type Database struct { DBUri string DBClient *mongo.Client DBCurrentCollection *mongo.Collection DBName string DBCurrentCollectionName string }
func (*Database) ConnectDB ¶
func (db *Database) ConnectDB(collection_name string) *mongo.Collection
DB CONNECTION
func (*Database) DumpLocations ¶
type DatabaseManagement ¶
type ImageUpload ¶
type ImageUpload struct {
Image *multipart.FileHeader `form:"image_upload", binding:"required"`
}
type ImageUploadWithID ¶
type ImageUploadWithID struct { Id string `uri:"id"` ImageUpload ImageUpload }
type Locations ¶
type Locations struct { LocationID primitive.ObjectID `bson:"_id"` Polygon []Coordinates `bson:"polygon"` AddedTime string `bson:"added_time"` AddedBy string `bson:"added_by"` IsInDanger bool `bson:"is_in_danger"` }
func FetchAllPolygons ¶
Click to show internal directories.
Click to hide internal directories.