Skip to content

ducnt114/go-getting-started

Repository files navigation

Go training for new team member

Run api

go run main.go api

Run migration scripts

go run main.go migrate

create migration file

make migration name=<input-name>

Install mockery

go install github.com/vektra/mockery/v2@latest

Swagger

go install github.com/swaggo/swag/cmd/swag@latest

Generate swagger docs

swag init

Generate JWT public and private key

# Generate a private key (private.pem) with 2048-bit RSA encryption
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048

# Extract the public key (public.pem) from the private key
openssl rsa -pubout -in private.pem -out public.pem

Google authentication qr format

otpauth://totp/Example:alice@google.com?secret=TTETFQGNNTNRHHSY&issuer=Example

use qr tool to generate qr code image

pip install qrcode

gen image

qr "otpauth://totp/Example:alice@google.com?secret=TTETFQGNNTNRHHSY&issuer=Example"

About

Learn Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors