Skip to content

This repository houses a collection of Go projects and code snippets developed for educational purposes.

Notifications You must be signed in to change notification settings

luizottavioc/go-concepts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This repository houses a collection of Go projects and code snippets developed for educational purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages