Sectoid Go Kit
The Sectoid Go Kit is a collection of micro libraries and useful modules for Go development.
Package Summaries
- ctxutils: Utilities for managing context and closing resources in a safe and error-handling manner.
- envutils: Utility functions for retrieving environment variables with default values and type conversions.
- grpcutils: Utility functions for converting gRPC errors into corresponding HTTP status codes.
- iterables: Utility functions for working with lists and maps.
- logmesh: Interfaces and implementations for logging with various log levels and methods.
- misc: Utility functions for various common tasks such as checking for nil pointers and retrying operations with timeouts.
- strutils: Utility functions for string conversions and manipulations.
- supermath: Utility functions for mathematical operations, including truncating floating-point numbers to a specific number of decimal places.
- timespace: Utility functions for converting between various timestamp formats and time representations.
Adding to Your Project
To use the Sectoid Go Kit in your Go project, follow these steps:
-
Initialize a new Go module (if you haven't already):
go mod init your_project_name
-
Add the Sectoid Go Kit as a dependency:
go get github.com/Sectoid-Systems/sectoid-go-kit
-
Import the desired packages in your Go files:
import (
"github.com/Sectoid-Systems/sectoid-go-kit/ctxutils"
"github.com/Sectoid-Systems/sectoid-go-kit/envutils"
// import other packages as needed
)
Development Instructions
To contribute to the Sectoid Go Kit, follow these steps:
- Clone the repository:
git clone https://github.com/Sectoid-Systems/sectoid-go-kit.git
- Navigate to the project directory:
cd sectoid-go-kit
- Install the required dependencies:
go mod tidy
- Make your changes and run the tests:
go test ./...
Makefile Commands
The project uses a Makefile to automate common tasks. Below is a summary of the available commands:
make build: Compiles the project.
make test: Runs the tests.
make clean: Cleans the build artifacts.
make lint: Runs the linter to check for code style issues.
make fmt: Formats the code.
To use these commands, simply run make <command> in your terminal.
License
The Sectoid Go Kit is licensed under the MIT License. See the LICENSE file for more information.