Giter VIP home page Giter VIP logo

scan-vulnarabilities-in-code's Introduction

GoLang Service

(GoLang , CHI, GORM, SQLite3)

This is REST API service that overs the following concepts

  • setup a CHI REST API service sertup (with/without Docker)
  • Basic Model, Schema creation in GORM
  • Basic CRUD operations using ORM objects
  • Scanning a directory with subdirectories and files to capture keywords

NOTE : This codebase was developed on go1.18.1

Technologies

GoLang

CHI REST Framework

GORM

Local Setup

  • initiate modules , run go mod init <example.com/reponame>
  • install dependencies from go.mod go mod download
  • install dependancies individually , example run go get -u github.com/go-chi/chi/v5
  • create .env file from .env-dist with appropriate local values
  • run the service go run .
  • run unit tests go test ./... -v -cover

File Structure

main.go - this is the entry point. handler mounted here will serve the REST APIS exposed by this service

handler - All the routes and controller methods to the API endpoints are defined here

models - All the Database entities are declared here

db - Database connection to sqlite3 and helper methods required to perform CRUD operations on DB entities are defined here

temp - temporary directory to place cloned public repos, each repo will cloned and remvoed programatically while scanning a public repository

repos_local.db - sqlite3 DB file

mock_http - mocks for unit testing

References

API Documentation

Postman Collection - GuardRails Service - APIs.postman_collection.json PDF - API Documentation.pdf

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.