dwyl / dwyl/learn-go

`Go` `WebSocket` Example with Push to `Postgres`

Open
#4 3 comments 1 reaction 1 assignee Claimed by @LuchoTurtle View on GitHub
documentation enhancement help wanted
Dominant language
Go
Stars
8
Forks
3
PR merge metrics
No merged PRs in 30d

Description

We need write a _lightweight_ (unauthenticated) `WebSocket` example in `Go`
that pushes data to a `Postgres` Database.
Essentially we are going to be replicating the [hits](https://github.com/dwyl/hits)
which just receives requests and logs them to the DB.

The most similar project is: https://github.com/dwyl/hits-nodejs in terms of simplicity/structure
except that the Node.js version is backed by `fs` not `Postgres`.

# Todo

+ [ ] Write a step-by-step guide to building a _basic_ "hits" service in `Go`
in _this_ repo under the subdirectory `/tutorial`
Starting point: https://gowebexamples.com/websockets looks like a concise example.
Which uses https://github.com/gorilla/websocket ref: https://gorilla.github.io
+ [ ] Make it as beginner-friendly as possible but it's safe to _assume_ the person already knows `Node/JS` 🔰
+ [ ] Include _all_ of the steps you took 📝
+ [ ] Use `Go Doc` comments to document all functions, see: https://tip.golang.org/doc/comment 📘
+ [ ] All code must be fully tested, ref: https://blog.jetbrains.com/go/2022/11/22/comprehensive-guide-to-testing-in-go/ ✅
+ [ ] Setup the `GitHub CI` pipeline to ensure tests are run on each `git push`. 🤖
+ [ ] Expand any sections of the `README.md` that you feel are needed.

GO!

> **Context**: We need this to pass basic events from the `Web UI` to the `Backend`.
Eventually each `WebSocket` channel will be authenticated using a `Token` (TBD)
that will be provided by our `SSO`...
But that's complexity we don't need to deal with at this stage and is just focus on the basic.

> **Note**: we _may_ end up shifting this to it's own repo e.g: `hits-go` in the _future_ ...
But for now, just use this repo and expand the

@LuchoTurtle this is a task for whenever you feel you have "free" time or are "waiting" for someone to ask you to do something.
Do it to the _best_ of your abilities because we will be _showing_ this to people who need to transition from `Node.js` to `Go`.
As usual, please log your progress as comments in this issue and/or commits in the brach.
Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.