go-codelab

command module
v0.0.0-...-8b60ee9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2016 License: MIT Imports: 12 Imported by: 0

README

go-codelab

Simple codelab tutorial for learning Go language. (https://mingrammer.com/go-codelab/)

Notes: This is "unofficial" tutorial. It was made by personal. If there are something wrong, please inform or fix that via Issues or Pull Requests.

It supports only korean docs now. We are preparing the english docs! :D

We'll make very tiny IoT application service with Go. Our example is that make the simple server and simple sensor device structures as clients. So clients can send their data to server in realtime.

Environments

  • OS Independent.
  • If possible, use the latest version because you are beginner of Go.
  • Check it on our codelab page. There is instruction steps for you.

Simple Overview

Assume that there are 3 sensors and we have a realtime server for handling the data from pipeline.

|---- Sensor1 ----\            /----- Server1 -----\
                   \          /                     \
|---- Sensor2 ----------------------- Server2 ---------------- Log handler
                   /          \                     /               |
|---- Sensor3 ----/            \----- Server3 -----/                |
         |                               |                          |
[Produce the data]             [Handle the request]         [Logging the data]

The sensors send produced data to pipeline concurrently using goroutine, so pipeline should queueing the streaming data then the server will fetch the data from pipeline by channel and processing with that.

What you can learn

This is for beginner of Go language.

If you finish this tutorial, you could get knowledges about

  • Go application structure
  • How to work Go application with packages
  • Go interface/struct model
  • Concurrency in Go
  • Communication way between goroutines using Go channel

Documentation

Overview

This file represents the server for sensors It opens communication links (for each sensor) through http protocol Port # 8001 for Gyroscope Sensor, Port # 8002 for Accelerator Sensor, Port # 8003 for Temperature Sensor. If the sensor client sends data through appropriate port, each http handler is initiated, decoding data to appropriate JSON file. Those datas are then logged to each sensor's log file (log/Accel.log , log/Temp.log , log/Gyro.log)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL