Skip to content

ariprasetiyo/sekawan-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sekawan-backend

golang project

config & db

  1. change .env.example to .env
  2. create database sekawan_web
  3. create ACL for access db sekawan_web
  4. grant all that user for access sekawan_web

init go modul

go mod init sekawan-backend

manage unused dependency

go mod tidy : removes unused dependencies automaticly

init gin gonic

go get -u github.com/gin-gonic/gin go get -u github.com/sirupsen/logrus go get -u github.com/joho/godotenv

init gorm

go get -u gorm.io/gorm go get -u gorm.io/driver/postgres go get -u github.com/pkg/errors go get -u github.com/uptrace/opentelemetry-go-extra/otelgorm go get -u github.com/gin-contrib/cors go get -t github.com/otiai10/gosseract/v2

go get -u github.com/valyala/fasthttp https://davidbacisin.com/writing/using-fasthttp-for-api-requests-golang?fbclid=IwAR2OLczNMA5-ENa6-blY7x0HpoLkfBlbWislUOxG6Qy-OH4dQxFMFBHxEWA

Telemetry

https://signoz.io/opentelemetry/go/ go get -u go.opentelemetry.io/otel go get -u go.opentelemetry.io/otel/exporters/otlp/otlptrace go get -u github.com/uptrace/opentelemetry-go-extra/otelgorm

go get -u "gocv.io/x/gocv" go get -u -d gocv.io/x/gocv

shortcut command

  1. mac : command f12 = call implementation code
  2. mac : option f12 = call reference code

run spesific unit test

go test app/main_test/curl_generator_test.go -v

run test generate password

go test -run TestGenerateUserAndPassword -v

run test generate clientky

go test -run TestGenerateClientIdAndClientKey -v

run test sample api

go test -run TestCurlRequestGenerateToken -v go test -run TestCurlRequestGenerateHTTPGet -v go test -run TestCurlRequestGenerateHTTPPost -v go test -run TestGenerateUserAndPassword -v

run test api trx

go test -run TestHttpGetToken -v go test -run TestOrderCarpet -v go test -run TestOrderListCarpetBySearch -v go test -run TestCustomerBySearch -v

curl

curl -X POST localhost:8083/public/token -H 'Client-Id: xxxxx' "Signature: " -d ""

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages