https://github.com/aldelo/common
Common helper and wrapper utility code for golang projects
https://github.com/aldelo/common
aes-256 golang helpers parser reflection utilities wrappers
Last synced: 3 months ago
JSON representation
Common helper and wrapper utility code for golang projects
- Host: GitHub
- URL: https://github.com/aldelo/common
- Owner: aldelo
- License: apache-2.0
- Created: 2020-08-16T20:03:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2026-03-31T06:04:57.000Z (3 months ago)
- Last Synced: 2026-03-31T08:32:45.625Z (3 months ago)
- Topics: aes-256, golang, helpers, parser, reflection, utilities, wrappers
- Language: Go
- Homepage:
- Size: 1.69 MB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# common
Common helper utilities and wrappers for code reuse.
When we code projects, we constantly encounter a similar set of functionality and logic. This package's intent is to wrap those commonly recurring functionalities and access points into a reusable helper package, so that we don't have to keep maintaining separate code bases.
This package will continue to be updated with more reusable code as well.
# Usage
- To use the common package:
- in the project folder root:
- go mod init
- go mod tidy
- For example, if project is "HelloWorld":
- /HelloWorld/go mod init
- /HelloWorld/go mod tidy
# types of helpers
- string helpers
- number helpers
- io helpers
- converter helpers
- db type helpers
- net helpers
- reflection helpers
- regex helpers
- time and date helpers
- uuid helpers
- crypto helpers (aes, gcm, rsa, sha, etc)
- csv parser helpers
- wrappers for aws related services
- service discovery / cloud map wrapper (using aws sdk)
- dynamodb / dax wrapper (using aws sdk)
- kms wrapper (using aws sdk)
- redis wrapper (using go-redis package)
- s3 wrapper (using aws sdk)
- ses wrapper (using aws sdk)
- sqs wrapper (using aws sdk)
- sns wrapper (using aws sdk)
- gin web server
- xray wrapper (using aws sdk)
- use xray.Init() to config
- use xray.SetXRayServiceOn() to enable xray tracing
- xray tracing is already coded into the following services:
- kms, cloudmap, dynamodb, redis, s3, ses, sns, sqs, mysql, gin
- wrappers for relational database access
- mysql wrapper (using sqlx package)
- sqlite wrapper (using sqlx package)
- sqlserver wrapper (using sqlx package)
- other wrappers
- for running as systemd service
- for logging and config
- for circuit breaker and rate limit
- etc.
# build and deploy automation
- Create a file such as 'build.sh' within project
- Edit file content as:
```
#!/bin/zsh
GOOS=linux GOARCH=amd64 go build
scp -i ~/.ssh/YourKey.pem YourBinary hostUserName@hostIP:/home/hostUserName/targetFolder
```
- Descriptions:
- YourKey.pem = the Linux Host SSH Certificate Key
- YourBinary = the Binary Build by go build to Upload
- hostUserName = the Linux Host Login Username
- hostIP = the Linux Host IP Address
- hostUserName = the Linux Host Login Username
- targetFolder = the Linux Host Folder Where SCP Will Upload YourBinary To