Git Product home page Git Product logo

crud-api-with-go's Introduction

CRUD with Golang


  • go mod init crud-with-go
    • This will create a go module with the name as go.mod in the proejct folder
  • go get "github.com/gorilla/mux"
    • We have used this gorilla/mux package to handle the routing in this application
    • We have installed the package using this command
    • We have 2 ways to install a package in command
      • go get <package_name>
      • go install <package_name>
    • But, the second one is deprecated and the first one is being used now. We can stil use the second one.
    • The only difference between them as far as I know is that get will check if the package is available, if not then it will download and then compile
    • Whereas install will directly compile, and will throw error if the package is not available
    • The get command will install the package in the GO_HOME
  • It has 5 routes/endpoints for the following:
    • /movies: will provide list of all the movies(Request: GET)
    • /movies: will create a movie(Request: POST). The request body should have the following structure
      {
        "isbn": "1193453248",
        "title": "Baahubali 2",
        "director": {
          "firstname": "S.S.",
          "lastname": "Rajamouli"
        }
      }
      
    • /movies/1: will provide movie with id = 1(Request: GET)
    • /movies/1: will delete movie with id = 1(Request: DELETE)
    • /movies/1: will update movie with id = 1(Request: PUT). The request body should be same as that of the Create Request

crud-api-with-go's People

Contributors

enigmaticmahesh avatar

Watchers

 avatar

crud-api-with-go's Issues

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.