Releases: nabbar/golib
Add features on router
Add :
- Gin Tonic Group route features
- default route group for no group
- func to allow init later a status router
- func to allow register in group a status router
- func to allow register in group a static router
- interface for Register in Group in router package
- check in header to avoid null map/slice
Change :
Add Package for archive/compressed files
Add Package Archive :
- func ExtractFile : recursive func to extract from any (zip, tar, bz2, gzip) archive/compressed file
- allow to push multiple compressed file, search for included file
- search based on included full path name and substrings pattern or regex matching
- return an os file pointer to temporary file
Add I/O Functions for temporary file :
- func NewTempFile to return an os Temp File pointer
- func GeTempFilePath to return the current full path of the given os Temp File pointer
- func DelTempFile to clean the given os Temp File pointer
Add test / example file for Archive Package :
- add a to test to print content of a go file in vendor folder from a zip => bz2 => tar => gzip => tar => vendor/.../file to print
- add a shell script to create an the example archive zip
Pkg Progress
Fix :
- decor bar counter
Update Package Progress
Add
- increment func in bar interface
- refill func in bar interface
- getMpb to get MPB lib objet in both bar & progresss interface
- add func NewBarSimpleCounter to use counter instead of ETA in progress interface
Chg
- rename func NewBarSimple to NewBarSimpleETA in progress interface
Add Package ProgressBar
Add Package Progress Bar :
- use multi bar lib (github.com/vbauerster/mpb/v5)
- implement njs-semaphore link
- update dependancies
Fix :
- build C (njs-ioutils) :
use/usr/bin/[i686|x86_64]github.com/vbauerster/mpb/v5 -c maxstdio.c
instead ofgcc -c maxstdio.c
to prevent implicit declaration
Add implementation of FD NOFILE rlimit
The rLimit is not implemented in Go for Windows.
This is beacause strictly rLimit does not exist in Windows.
But security of Windows use similar function to limite File Descriptor I/O
This version add a implementation of C call of the windows function to offer similar functionnalities
For Windows build, please follow this note :
Install required packages
Install package to build C source with GCC (need sometimes to details package x86_64 for win64 and i686 for win32 package)
- gcc-multilib
- gcc-mingw-w64
sudo apt-get install gcc-multilib gcc-mingw-w64
Normally, you will having this binaries
- i686-w64-mingw32* for 32-bit Windows;
- x86_64-w64-mingw32* for 64-bit Windows.
Locate you binaries gcc mingw path and note it:
- win32 : updatedb && locate i686-w64-mingw32-gcc
- win64 : updatedb && locate x86_64-w64-mingw32-gcc
Rebuild object C if needed
if you have an error in the build, or if the .o object file is not present in golib/njg-ioutils/maxstdio/
, run this step
cd golib/njg-ioutils/maxstdio
gcc -c maxstdio.c
Build you go code with the C dependancies :
We will specify some env var in prefix of launching line of go build.
We recommend to use the -a flag of go build to force system to rebuild all dependancies and do not use precompiled code
For Win32 :
CC=/usr/bin/i686-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=386 go build -a -v ...
For Win64 :
CC=/usr/bin/x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -a -v ...
Add new package semaphore & new function in IOutils
Add new package for semaphore :
- Semaphore interface
- constructor with context handling
- func for managing worker
- func for cancel
Add func for IOutils
- fileDescriptor function to retrieve or try to change the current file descriptor setting
Change :
- Bump dependancies
Fix console/color
Fix :
- issue 03 : missing calling lib functionn
Add :
- Add function buffPrintf : printf directly into a bufio pointer
Chg :
- Bump dependancies
Add trace option in package Errors
Add trace management in error package :
- Upd function ErrorWithCode to ErrorFull in ErrorCode interface
- Upd function StringWithCode to StringFull in ErrorCode interface
- Add attached function Trace in ErrorCode interface
- Upd function GetErrorCode
- Add function GetTraceErrorCode
- Fix doc comments
Add Package njs-errors
Add New package to manage Error (string) with code :
- Add a type ErrorType
- Add attached func String to ErrorType
- Add attached func Error to ErrorType
- Add ErrorCode interface
- Add attached func Error to ErrorCode
- Add attached func ErrorWithCode to ErrorCode
- Add attached func String to ErrorCode
- Add attached func StringWithCode to ErrorCode
- Add attached func Code to ErrorCode
- Add list management func SetErrorCode
- Add list management func SetErrorCodeString
- Add list management func DelErrorCode
- Add list management func DelAllErrorCode
- Add list management func GetErrorCode