Code Monkey home page Code Monkey logo

go-crud-example's Introduction

  1. Compile Daemon
  • Deşiklikleri algılayıp restart atar
go get github.com/githubnemo/CompileDaemon

CompileDaemon -command="./go-http -my-options"
  • ./go-http dosya yolu
  • -my-options alabileceği özel parametreler

  1. GoDotEnv
  • .env dosyasından değer okumayı sağlar
go get github.com/joho/godotenv

  1. Gin
  • Web framework'üdür
go get -u github.com/gin-gonic/gin

  1. Gorm
  • ORM
go get -u gorm.io/gorm

-u update -> modülün en son sürümünü getir demek

  • Driver
go get -u gorm.io/driver/postgres

migrate

  • Database tablosu oluşturur onun için projeden önce run edilmeli ve main paketi altında run edilebilir olmalıdır
go run migrate/migrate.go

Swagger

go get -u github.com/swaggo/swag/cmd/swag
go install github.com/swaggo/swag/cmd/swag@latest
swaggo -h
go get -u github.com/swaggo/files
go get -u github.com/swaggo/gin-swagger
// Add Swagger
r.GET("/docs/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
swag init

main.go

import (
	// Aşağıdakini ekle
	_ "go-http/docs"
	"github.com/gin-gonic/gin"
	swaggerFiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
	"go-http/controllers"
	"go-http/initializers"
)

func init() {
initializers.LoadEnvVeriables()
initializers.ConnectToDB()
}

// @title Tag Service API
// @version 1.0
// @description Description

// @host localhost:8888
// @BasePath /api
func main() {
swag init

go-crud-example's People

Contributors

furkankayam avatar

Stargazers

Adil NAS avatar Ebrar KILIÇ 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.