🍀 Go basic library. || Go语言基础库


Go语言基础库





        


工程目录说明

pkg/                    ...... 源码包
    |-- bininfo/        ...... 将编译时源码的git版本信息(当前commit log的sha值和commit message),编译时间,Go版本,平台打入程序中
    |-- nazalog/        ...... 日志库
    |-- assert/         ...... 提供了单元测试时的断言功能,减少一些模板代码
    |-- nazaerrors/     ...... error相关
    |-- fake/           ...... 实现一些常用的接口,hook一些不方便测试的代码
    |-- taskpool/       ...... 非阻塞协程池,协程数量可动态增长,可配置最大协程并发数量,可手动释放空闲的协程
    |-- defertaskthread ...... 执行延时任务
    |-- bele/           ...... 大小端转换操作
    |-- nazabits/       ...... 位操作
    |-- bitrate/        ...... 计算带宽
    |-- ratelimit/      ...... 限流器,令牌桶,漏桶
    |-- connection/     ...... 对net.Conn接口的二次封装
    |-- nazanet/        ...... socket操作相关
    |-- nazahttp/       ...... http操作
    |-- circularqueue   ...... 底层基于切片实现的固定容量大小的FIFO的环形队列
    |-- lru/            ...... LRU缓存
    |-- consistenthash/ ...... 一致性哈希
    |-- nazajson/       ...... json操作
    |-- nazamd5/        ...... md5操作
    |-- nazaatomic/     ...... 原子操作
    |-- crypto/         ...... 加解密操作
    |-- slicebytepool/  ...... []byte内存池
    |-- nazastring/     ...... string和[]byte相关的操作
    |-- unique/         ...... 对象唯一ID
    |-- snowflake/      ...... 分布式唯一性ID生成器
    |-- nazareflect/    ...... 利用反射做的一些操作
    |-- filebatch/      ...... 文件批处理操作
    |-- ic/             ...... 将整型切片压缩成二进制字节切片
playground/             ...... Go实验代码片段
demo/                   ...... 示例相关的代码
bin/                    ...... 可执行文件编译输出目录

依赖

无任何第三方依赖

相关文档

联系我

欢迎扫码加我微信,进行技术交流或扯淡。

项目名 naza 由来

本仓库主要用于存放我自己写的一些 Go 基础库代码。目前主要服务于我的另一个项目: lal

naza 即哪吒(正确拼音为 nezha,我女儿发音读作 naza,少一个字母,挺好~),希望本仓库以后能像三头六臂,有多种武器的哪吒一样,为我提供一个趁手的工具箱。

Owner
yoko
c++, Go, network, system, audio&video.
yoko
Similar Resources

A Go (golang) library for parsing and verifying versions and version constraints.

go-version is a library for parsing versions and version constraints, and verifying versions against a set of constraints. go-version can sort a collection of versions properly, handles prerelease/beta versions, can increment versions, etc.

Jan 9, 2023

A library for parsing ANSI encoded strings

 A library for parsing ANSI encoded strings

Go ANSI Parser converts strings with ANSI escape codes into a slice of structs that represent styled text

Sep 20, 2022

go generate based graphql server library

go generate based graphql server library

gqlgen What is gqlgen? gqlgen is a Go library for building GraphQL servers without any fuss. gqlgen is based on a Schema first approach — You get to D

Dec 29, 2022

This is Go library for building GraphQL client with gqlgen

gqlgenc What is gqlgenc ? This is Go library for building GraphQL client with gqlgen Motivation Now, if you build GraphQL api client for Go, have choi

Jan 7, 2023

A library for diffing golang structures

Diff A library for diffing golang structures and values. Utilizing field tags and reflection, it is able to compare two structures of the same type an

Dec 29, 2022

Go library for decoding generic map values into native Go structures and vice versa.

mapstructure mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling. This l

Dec 28, 2022

A well tested and comprehensive Golang statistics library package with no dependencies.

Stats - Golang Statistics Package A well tested and comprehensive Golang statistics library / package / module with no dependencies. If you have any s

Dec 30, 2022

go-sundheit:A library built to provide support for defining service health for golang services

go-sundheit:A library built to provide support for defining service health for golang services

A library built to provide support for defining service health for golang services. It allows you to register async health checks for your dependencies and the service itself, and provides a health endpoint that exposes their status.

Dec 27, 2022

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al.

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al.

Go library that provides fuzzy string matching optimized for filenames and code symbols in the style of Sublime Text, VSCode, IntelliJ IDEA et al. This library is external dependency-free. It only depends on the Go standard library.

Dec 27, 2022
Comments
  • 添加编译版本时间等信息Makefile方案

    添加编译版本时间等信息Makefile方案

    参考博主文章https://zhuanlan.zhihu.com/p/88688319

    
    .PHONY: all build deploy help
    BINARY=$(shell basename "$(PWD)")
    WORKDIR=`pwd`
    
    default: deploy
    
    CUR_DIR := $(shell pwd)
    CUR_TIME := $(shell date +"%Y-%m-%d_%H:%M.%S")
    
    
    # 获取git tag版本号
    GitTag :=$(shell git tag --sort=version:refname | tail -n 1)
    # 获取源码最近一次git commit log,包含commit sha 值,以及commit message
    GitCommitLog :=$(shell git log --pretty=oneline -n 1)
    # 将log原始字符串中的单引号替换成双引号
    # GitCommitLog :=${GitCommitLog//\'/\"}
    # 检查源码在git commit基础上,是否有本地修改,且未提交的内容
    GitStatus := $(shell git status -s)
    # 获取当前时间
    BuildTime := $(shell date +"%Y-%m-%d_%H:%M.%S")
    # 获取Go的版本
    BuildGoVersion := $(shell go version)
    
    LDFLAGS=-ldflags "-s -w \
        -X 'github.com/q191201771/naza/pkg/bininfo.GitCommitLog=${GitCommitLog}' \
        -X 'github.com/q191201771/naza/pkg/bininfo.GitStatus=${GitStatus}' \
        -X 'github.com/q191201771/naza/pkg/bininfo.BuildTime=${BuildTime}' \
        -X 'github.com/q191201771/naza/pkg/bininfo.BuildGoVersion=${BuildGoVersion}' \
    "
    
    all:
    	@echo $(CUR_DIR)
    	@echo $(CUR_TIME)
    
    
    build:
    	go build ./
    
    deploy:
    	@echo "build notify"
    	@echo ${LDFLAGS} 
    	@go build -o ${BINARY} -v ${LDFLAGS} 
    
    help:
    	@echo "make 格式化go代码 并编译生成二进制文件"
    	@echo "make build 编译go代码生成二进制文件"
    	@echo "make deploy 生成二进制文件并发布"
    
Minimalistic library for basic matrix operations.

MATRIX Maybe a bit slow, but minimalistic library for basic matrix operations. Available functions Function signature Description Equal(a, b [][]float

Nov 4, 2021
Cpu-profiling - Basic example of CPU Profiling in Golang which shows the bottlenecks and how much time is spent per function

cpu-profiling Basic example of CPU Profiling in Golang which shows the bottlenec

Aug 2, 2022
Govalid is a data validation library that can validate most data types supported by golang

Govalid is a data validation library that can validate most data types supported by golang. Custom validators can be used where the supplied ones are not enough.

Apr 22, 2022
Maintain a lower-bitrate copy of a music library in sync with the main copy.

msync Maintain a lower-bitrate copy of your music library, in sync with the main copy.

Mar 6, 2022
Golang library to act on structure fields at runtime. Similar to Python getattr(), setattr(), hasattr() APIs.

go-attr Golang library to act on structure fields at runtime. Similar to Python getattr(), setattr(), hasattr() APIs. This package provides user frien

Dec 16, 2022
Go library for HTTP content type negotiation

Content-Type support library for Go This library can be used to parse the value Content-Type header (if one is present) and select an acceptable media

Jul 10, 2022
A tool and library for using structural regular expressions.

Structural Regular Expressions sregx is a package and tool for using structural regular expressions as described by Rob Pike (link).

Dec 7, 2022
A super simple Lodash like utility library with essential functions that empowers the development in Go
A super simple Lodash like utility library with essential functions that empowers the development in Go

A simple Utility library for Go Go does not provide many essential built in functions when it comes to the data structure such as slice and map. This

Jan 4, 2023
go-sysinfo is a library for collecting system information.

go-sysinfo go-sysinfo is a library for collecting system information. This includes information about the host machine and processes running on the ho

Dec 26, 2022
Molecule is a Go library for parsing protobufs in an efficient and zero-allocation manner

Molecule Molecule is a Go library for parsing protobufs in an efficient and zero-allocation manner. The API is loosely based on this excellent Go JSON

Jan 5, 2023