nbx

command module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 1 Imported by: 0

README

Nbx

A collection of reusable packages and CLI tools for common development tasks like logging, database utilities, data conversion, transaction management, and enum generation.

Introduction

nbx is a personal Go toolbox containing a collection of reusable packages and command-line interface (CLI) tools. The goal is to provide convenient, well-tested components for common tasks encountered during Go development, fostering code reuse and efficiency.

Features

The toolbox currently includes the following key packages and CLI tools:

  • pkg/logger: A flexible logging library with different modes, adapters (e.g., gRPC interceptors), encoders, and configurable log levels.
  • pkg/dbu: Database utilities including helpers for building update maps for relational databases (RDB, like GORM) and MongoDB, handling struct tags, default naming, and pointer values.
  • pkg/pbconv: Protocol Buffer conversion helpers (details based on code, assumed to help convert between Go types and protobuf types).
  • pkg/transaction: Helpers and a TransactionManager pattern for managing database transactions cleanly, especially with GORM, by passing the transaction via context.Context.
  • cmd/enumgo: A CLI tool (nbx enumgo) to generate Go enum code directly from YAML definition files.

Getting Started

To get the nbx toolbox and its source code, you can clone the repository:

git clone [https://github.com/yimincai/nbx.git](https://github.com/yimincai/nbx.git)

Documentation

Overview

Copyright © 2025 Yi Min, Cai <[email protected]>

Directories

Path Synopsis
example
dbu command
logger command
internal
pkg
dbu

Jump to

Keyboard shortcuts

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