Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luizottavioc/go-concepts
This repository houses a collection of Go projects and code snippets developed for educational purposes.
https://github.com/luizottavioc/go-concepts
api file-upload go gochannels golang goroutine http json mongodb
Last synced: 26 days ago
JSON representation
This repository houses a collection of Go projects and code snippets developed for educational purposes.
- Host: GitHub
- URL: https://github.com/luizottavioc/go-concepts
- Owner: luizottavioc
- Created: 2023-12-04T20:26:01.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-11T19:57:44.000Z (about 1 year ago)
- Last Synced: 2024-11-20T17:37:10.894Z (3 months ago)
- Topics: api, file-upload, go, gochannels, golang, goroutine, http, json, mongodb
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-concepts
This repository houses a collection of Go projects and code snippets that I've developed for educational purposes.## Services
Folder with services that run complete flows.
- auto-import-users: Service that reads, from time to time, an API that returns random users in a random quantity. After reading user data, it is incremented to a .json file in the ```./files``` folder. With this data saved in the file, after a specific number of increments in the file, it is read, deleted and saved in a MongoDB database (accessible through docker-compose.yaml from the root). Reading and writing to the file is controlled using an auxiliary variable that blocks writing during reading so that deletion does not result in data loss.
## MongoDB
Folder with scripts for manipulating MongoDB. Is accessible by docker-compose.yaml from the project root
- hello-world: Database connection test that creates a ```"hello-world"``` collection (if it does not exist), cleans the documents in this collection and adds a single ```{"hello":"world"}```.
- users: Script that adds users provided from an API every 3 records at each run.## Goroutines
Folder with files containing tests for using goroutines and communication channels.
- channels.go: Execution of two goroutines that share common channels. One goroutine prints numbers and another prints letters. They are executed together and only after the registration of the completion channels is the flow completed.
- routines.go: Basic goroutine execution tests.## Http
Folder with files for consuming external APIs via HTTP.
- random-data-api.go: Reads data from a random API, which can return data from a user, an address or a appliance.
- cat-api.go: Consumption of an API that returns random cat species data.## OS
Folder with scripts for file manipulation.
- incrementing-json.go: Script that increments json results from a cat API into a common file.
- incrementing-file.go: Script that increments lines in a text file.