go-utils

module
v0.0.0-...-4a7beed Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT

README

go-utils

Utils for golang

install:

go get -u github.com/onesaltedseafish/go-utils

The functions are listed below:

  • Shell 包装好的方便调用的系统命令
    • 简单好用
    • 支持传递context.Context进行控制
  • Reader 包装好的读取各种格式的文件
    • csv 文件
    • txt (以\t为分隔符)
  • Writer 包装好的写各种格式的文件
    • csv 文件
  • Simulate 模拟的实现
    • dhcp 模拟 DHCP 协议分布 IP 地址

linters

Use golangci-lint to lint Code.

Log Utils

install:

go get -u github.com/onesaltedseafish/go-utils/log

Log 开箱即用的 logger库,提供以下功能:

  • 简单好用的 Console 日志输出
  • 简单好用的 Json 日志文件输出
  • 日志等级过滤
  • 分布式 traceid 支持
  • otelzap 支持

Directories

Path Synopsis
examples
gorm-logger
Package main TODO
Package main TODO
logger
Package main TODO
Package main TODO
log module
reader module
Package shell wraps exec.Command
Package shell wraps exec.Command
simulate
dhcp
Package dhcp simuates how dhcp protocol allocates ip address
Package dhcp simuates how dhcp protocol allocates ip address
dhcp/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
writer module

Jump to

Keyboard shortcuts

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