Giter Club home page Giter Club logo

go_glossary_tutorial's Introduction

go_glossary_tutorial

A tutorial on how I created Golossary. Check out the live streams here

Overview

This tutorial will show you how to create a simple HTTP API in Go. The API will accept text as part of the request and return JSON of the words and definitions. Behind the scenes, we will be making a call to a free dictionary API. I will guide you from "Hello World" all the way to a command line app you can use to generate a glossary.

What are the requirements?

  • A basic understanding of Go.
  • A properly configured install of Go.
  • A basic understanding of how the web works.

What is the target audience?

  • Someone wanting to learn how to build and consume API's in Go

When are the streaming sessions (streaming schedule)? Every Monday at 1900 (7:00PM) PST until the project is complete.

Session breakdown

Session 1: Setting up main and calling the dictionary API

  • Setting up the project
  • Create Hello World
  • Making a simple call to the dictionary API

Result: A program that can get JSON from the dictionary API and print it to the screen.

Session 1.5: Dictionary server was down so we made a weather API using OpenWeatherMap

  • Used my goapi tool to generate the structs to parse JSON returned from Open Weather Map
  • Created a command line program to make a call to OpenWeatherMap with our given lat and lon

Result A program that accepts a lattitude, longitude, and perfered tempature unit and returns the weather for that location.

Session 2: Parsing the response and abstracting our dictionary

  • Use the Go standard library to parse JSON
  • Create structs to parse the Pearson API
  • Use a tool I made to simplify consuming API's (with explanation how it works)
  • Creating an abstraction

Result: A program that can parse JSON from the dictionary and print only the definition to the screen.

Session 3: Parse a text file, call the API, and clean up code.

  • Load a text file and parse the text from it
  • Call the API for each unique word we find
  • Add command line flags

Result: A program that can parse the text from a file and define all of the unique words in that file.

Resources

go_glossary_tutorial's People

Contributors

vohumana avatar

Watchers

James Cloos 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.