You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/AndrewBennettDev/go-weather-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/AndrewBennettDev/go-weather-api

v0.0.0-20240814190231-eb73bb4dc802
Source
Go
Version published
Created
Source

Weather API (Golang)

Intro

Welcome to my personal Weather API powered by Go! This has been a fun personal project for really learning Golang, as well as thinking more about what I want in a backend service. As of this version there are three main components:

Components

  • API - using gorilla/mux you can currently call a single endpoint that calls both the Current Weather and Astronomy endpoints from Weather API. The Transform class then combines these and returns one set of data. There are placeholders for healthchecks now and a "list" endpoint in case I implement more endpoints later.
  • Transform - each API call returns data that is not useful for me. Rather than store and display things I do not need I am using a simple transform function.
  • Database - as of my most recent work this layer now interacts with a locally hosted instance of MariaDB/MySQL. I only have a basic implementation that allows me to create the table if it does not exist, and write data to that table whenever the primary endpoint is hit. Other queries to be written soon! 3a) Mongo Databse - I am also experimenting with MongoDB, and eventually I would like to be writing to both (locally) whenever I hit the weather and astronomy endpoints. For now you will likely see one or the other implemented as I'm learning and experimenting.

Other Notes

Once these pieces are all functional this will live on my personal website (oh yeah, I need to build that, too...) as a widget, with the goal of implementing this same basic format in multiple languages so you can see how they perform relative to the others. This will likely be a running project for many years as I continue to add fun bits to it!

Note: this repo lives on GitHub and GitLab; I love both so there may eventually be deploy files for either/both!

I am always open to constructive criticism and suggestions, so please do not hesitate to point out errors or potential optimisations.

FAQs

Package last updated on 14 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts