Giter Site home page Giter Site logo

go_weather_go's Introduction

Go_weather_go

Contents

  1. Presentation

  2. Prerequisites to run the utility on machine host

  3. Prerequisites to run the utility with Docker

  4. How run the utility on machine host

  5. How run the utility with Docker

Presentation

This is a project to develop a golang utility to get weather datas using the OpenWeatherMap API.

Here is the datas returned:

  • name of the whished city and its country code,

  • coordinates (longitude and latitude),

  • main weather,

  • weather description,

  • current temperature,

  • feeling temperature,

  • maximum expected temperature,

  • minimum expected temperature,

  • sunrise time,

  • sunset time,

  • atmospheric pressure,

  • UV index (value and risk),

  • humidity,

  • wind (speed and direction).

To use it, you must have an Openweathermap's API key.

To get it, all are explained here.

Prerequisites to run the utility on machine host

You must install Go language on your machine.

To do this, you can consult the official documentation here.

Or you can install it by executing this command if you're on Debian or Ubuntu distribution:

sudo apt install golang-go

Well done. It's your turn to play now...

Prerequisites to run the utility with Docker

First, you must install Docker on your machine.

To do this, you can consult the official documentation here.

Or Or you can install it by executing this command if you're on Debian or Ubuntu distribution:

sudo apt install docker.io

Well done. It's your turn to play now...

How run the utility on machine host ?

To run this utility, you can execute this commands:

go build go_weather_go.go

./go_weather_go -city=<wished_city_name> -apiKey=<OpenWeatherMap_API_key> -tempScale=<wished_temperature_scale>

or this single one:

go run go_weather_go.go -city=<wished_city_name> -apiKey=<OpenWeatherMap_API_key> -tempScale=<wished_temperature_scale>

How run the utility with Docker

To run this utility with Docker, you can build the Docker image from Dockerfile or you can pull the official Docker image on Docker Hub.

If you choose the last option, you can get the offical Docker image is here.

Now if you choose to build the Docker image from Dockerfile, follow these instructions in the order:

git clone https://gitlab.imerir.com/eric.ghoubiguian/go_weather_go # Clone the project from gitlab

cd go_weather_go # Change current folder for the project's one

docker image build -t go_weather_go . # Build the Docker image using Dockerfile

Now you are ready...

You can run the utility in Docker executing this command:

docker container run -it go_weather_go -city=<wished_city> -apiKey=<wished_api_key> -tempScale=<wished_temperature_scale>

Now let's go...

go_weather_go's People

Contributors

vicken-ghoubiguian avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.