users-api

command module
v0.0.0-...-4f48353 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 10 Imported by: 0

README

Simple blog system

users-api

Simple Github User API Ready Prod.

Quick start

Quick start you must install docker, docker-compose, Git and Fiber-Swagger.

Create new docker network

➜ sudo make network-prune
➜ sudo make network

Builds and tests

git clone https://github.com/edlorenzo/users-api.git
cd users-api
chmod o+w ./tests/postman
sudo chmod a+x start.sh
sudo ./start.sh

Press Ctrl + c to stop application.

Getting started

Install Golang (go1.17+)

Please check the official golang installation guide before you start. Official Documentation Also make sure you have installed go1.17+ version.

For more info and detailed instructions please check this guide: Setting GOPATH

Initialize Swagger Docs
go install github.com/swaggo/swag/cmd/swag@latest
make swagger-init
Working with makefile
make help
Install dependencies
➜ go mod download
➜ make tidy
Run
➜ go run main.go
Build
➜ go build
Tests
➜ make test
Swagger UI

Access the application using the port 5007. Open url http://localhost:5007/swagger/index.html in browser.

Swagger Result

Another Redis Desktop Manager

Visualizing data stored from Redis using Another Redis Desktop Manager.

Redis Result

List of technology used:
Solutions and Integration Section
  • Response data is sorted by name in ascending order.
	sort.Slice(r.User.Data[:], func(i, j int) bool {
		return r.User.Data[i].Name < r.User.Data[j].Name
	})
  • Iteration can be resumed if some usernames cannot be found.
  • Caching feature to store user data in 2 minutes. If user's information has been cached, it should NOT hit Github again to retrieve the same user, instead it should return the user from the cache.
  • Logrus integration for good error handling and logs.
  • Added Http network feature to validate incoming http request.
  • Only used pure http to call Github user api.
  • Integration of swagger api documentation.
  • Redis data store and data fetch, using serialize and deserialization approach to meet proper storing of data as redis only allowed flat data storing.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT This file was generated by swaggo/swag
integration

Jump to

Keyboard shortcuts

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