GithubHelp home page GithubHelp logo

go_back_sample's Introduction

Go Lang Backend

  • Author: donghquinn

Dependencies

  • gin: Web Framework
go get -u github.com/gin-gonic/gin
  • Gin Usage

    • Post Body Data Parsing
      • Bind with Body Data Structures.
      • Structure can be defined with expression json:"body1" xml:"body1" binding:"required"
      • can be validate with ShouldBind() method
  • godotenv: load .env file

go get -u github.com/joho/godotenv
  • prisma: Data ORM Client
go get -u github.com/steebchen/prisma-client-go
  • validator: Request Validator. You don't need to install package manually.
    • How to make custom validator: Korean Reference
    • Unlike node.js, you can validate requests by tags.
    • And of course, you can make custom tags as well: Korean Reference

Prisma Initiate

  • If you get Prisma Module, Please make schema, File name is schema.prisma. Check prisma/schema.prisma as reference on this repository.
  • Run Database you want, and write its dataurl into .env file.
    • format: [databaseType]://[userName]:[userPassword]@[hostAddr]:[hostPort]/[databaseName]?schema=[public / private]
  • Then Run command below to initiate prisma client. This command line will create the package name "db"
go run github.com/steebchen/prisma-client-go generate

File Structures

Controllers

data

  • Prisma Client and Query Modules

DTO

  • Data Transfer Object
    • Formulized Response with throw keys;
      • resCode: Response Code - 200 / 40* /500
      • dataRes: Actual Result of Request
      • errMsg: There would be Error message, if there were any error happend.

libraries

  • calculator: Simple functions add / sum

module

  • handler: router Handling Modules

utilities

  • shutdown: Graceful Shutdown

types

  • calc_request: Calculation Request Type Definition

validators

go_back_sample's People

Contributors

donghquinn avatar

Watchers

 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.