GithubHelp home page GithubHelp logo

mariusciotir / golang-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amitkumardube/golang-api

0.0 0.0 0.0 27 KB

Here we will work on some golang activities on google cloud

Go 54.74% HTML 40.11% Dockerfile 5.15%

golang-api's Introduction

golang - api

golang API to perform the CRUD operations

  • C : create
  • R : read
  • U : update
  • D : delete

What these APIs do?

  • The APIs perform CRUD operations on the string
  • To keep it lightweight project, the APIs don't connect to database

How to use this project?

  • install go binary and configure GOROOT env variable as per the location of GO binary
  • create a directory structure dir_path/src. Where dir_path should be set as GOPATH env variable
  • clone this code under src repo
  • run go run main.go and the application will start on port 8000

List of APIs

How to use automated testing

  • The go testing package supports automated testing.
  • In order to run test testcases , please run go test -v ./...
  • This will trigger test cases in all the packages ( root and sub packages ).
  • To see the test coverage, please use flags like -cover and -coverprofile while running to test command.
  • Commands are go test -v -cover ./... or go test -v -coverprofile=cover.txt ./...
  • Once you have cover.txt file, you can use a built in tool called cover to create an html report from this txt file.
  • Command is - go tool cover -html=cover.txt -o cover.html.
  • Open cover.html in browser to review the test coverage.

Dockerfile

  • Application is using go module.
  • It's important to copy go.mod and go.sum along with main.go in image for go to download dependencies at run time.
  • This file completely defines the structure of your application.

docker-compose.yml

  • This is declarative way of writing docker image.
  • We can create multi container applications using docker-compose.
  • docker-compose up will start the container application.
  • docker-compose down will stop all the container application.

golang-api's People

Contributors

amitkumardube avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.