go-gin-gee

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: MIT

README

go-gin-gee

Gee provides several services for everyday life. The project is based on Gin, and the structure refers to ProjectLayout. There are some daily scripts in the folder Scripts depending on Script, which can run by the command Run.

Table of Contents

Install

git clone git@github.com:mazeyqian/go-gin-gee.git

Build

Default:

go build cmd/api/main.go
Linux

It's usually useful to run the command chmod u+x script-name-linux-amd64 if the permission error happens.

# API
GOOS=linux GOARCH=amd64 go build -o dist/api-linux-amd64 cmd/api/main.go

# Scripts
GOOS=linux GOARCH=amd64 go build -o dist/init-linux-amd64 scripts/init/main.go
Mac
# API
GOOS=darwin GOARCH=amd64 go build -o dist/api-mac-darwin-amd64 cmd/api/main.go

# Scripts
GOOS=darwin GOARCH=amd64 go build -o dist/init-mac-darwin-amd64 scripts/init/main.go
Windows
# API
GOOS=windows GOARCH=amd64 go build -o dist/api-windows-amd64 cmd/api/main.go

Deploy

Supervisor Config:

[program:api]
directory=/web/go-gin-gee
command=/web/go-gin-gee/dist/api-linux-amd64
autostart=true
autorestart=true
stderr_logfile=/web/go-gin-gee/log/api.err
stdout_logfile=/web/go-gin-gee/log/api.log

API Examples

Change git user and e-mail in a folder.

go run scripts/change-git-user/main.go

Git pull all projects in a folder.

go run scripts/batch-git-pull/main.go

Transfer apple note table to markdown table.

go run scripts/transfer-notes-to-md-table/main.go

More in folder scripts.

Contributing

# All Dependences
go mod download

# Add
go get github.com/example/name

If i/o timeout, run the command to replace the proxy:

go env -w GOPROXY=https://goproxy.cn

It's necessary to run the command go run scripts/init/main.go when serving the project first.

# Serve
go run cmd/api/main.go

# Restart
# cd /web/go-gin-gee
go run scripts/restart/main.go

Visit: http://127.0.0.1:3000/api/ping.

pong/v1.0.0/2022-09-29 04:52:43

Reference

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL