This repository was archived by the owner on Apr 1, 2023. It is now read-only.
Releases: xgfone/go-tools
Releases · xgfone/go-tools
v7.0.0
Simply the package and remove the unnecessary functions.
- Added:
- Add the function
GetAllNetIPs
to get all the network ips like127.0.0.1/8
. - Add the default buffer pools
BufferPool1k
,BufferPool2k
,BufferPool4k
andBufferPool8k
.
- Add the function
- Changed:
- Rename the function
WalkDirFull
toWalkDir
. - Rename the function
HandleSignalWithFunc
toHandleSignalWithCallback
. - Remove the function
GetFieldTags
and renameGetFieldTagsMap
toGetFieldTags
. - Remove the function
GetStructTags
and renameGetStructTagsMap
toGetStructTags
. - Extract the type cast from the sub-package
types
to the external packagegithub.com/xgfone/cast
. NewBytesPool
returns*BytesPool
instead ofBytesPool
andNewBufferPool
returns*BufferPool
instead ofBufferPool
.- Change the type of the handler of
TCPServer
fromfunc(conn *net.TCPConn, isStopped func() bool)
tofunc(context.Context, *net.TCPConn)
.
- Rename the function
- Removed:
- Remove the whole sub-packages
option
andsync2
. - Remove the
ResourcePool
from the sub-packagepools
. - Remove the function
ReadLine
from the sub-packageio2
. - Remove the function
TCPServerForever
from the sub-packagenet2
. - Remove the Split functions
SplitXXX
from the sub-packagestrings2
. - Remove the function
HandleSignalWithLifecycle
from the sub-packagesignal2
. - Remove the default buffer pool
DefaultBufferPool
from the sub-packagepools
. - Remove the functions
GetSliceValue
,PullSliceValueWithDefault
,PullSliceValue
,Reverse
from the sub-packagefunctions
. - Remove the functions
Type
,IsExist
,IsFile
,IsDir
,SelfPath
,SelfDir
,EnsureDir
,MTime
,Size
from the sub-packagefile
. - Remove the
Convert
, theConverter
and the type cast functions, likeToXXX
andMustToXXX
, from the sub-packagetypes
.
- Remove the whole sub-packages
v6.1.0
- Added:
- Cmd: Add
CmdError
to wrap the error returned byCmd
. - Cmd: Add the lock to execute the command goroutine-safely .
- Cmd: Add the result hook
ResultHook
to handle the result ofCmd
. - Set: Add the method
String
to print the set. - Set: Add the method
ForEach
instead of the deprecatedWalk
. - Set: Add the function
NewSetFromSlices
and the methodAddSlices
to add the elements of the slice or array into the set. - SMap: Add the new type
SMap
to wrapmap[string]interface{}
.
- Cmd: Add
- Changed:
- Cmd: Change the field
hooks
toHooks
to export it.
- Cmd: Change the field
v6.0.0
- Added:
- Support Semantic Import Versioning, and move the imported path from
github.com/xgfone/go-tools
togithub.com/xgfone/go-tools/v6
. - The method
AppendAny
ofBuilder
supportsio.WriterTo
. - Add the default timeout for
Cmd
in the sub-packageexecution
.
- Support Semantic Import Versioning, and move the imported path from
- Changed:
- Remove the sub-package
errors
. - Remove the deprecated functions and interfaces.
- Either of the arguments
in
andout
ofRegisterChannel
may benil
.
- Remove the sub-package
v5.13.0
v5.12.0
- Added:
- Add the error handler
ErrHandler
fornet2.TCPServer
. - Add
Connection()
to get the number of the connection fornet2.TCPServer
. - Add
RegisterOnShutdown()
to register the shutdown callback fornet2.TCPServer
.
- Add the error handler
- Fix:
Start
ends whennet2.TCPServer
is closed.
v5.11.1
v5.11.0
v5.10.0
- Added:
- Add the error based on key-value
KvError
. - Add the command executor
Cmd
and add the hook feature for it. - string builder
Builder
:AppendAny
of the string builder supports themap
andslice
type.- Add the method
AppendAnyFmt
for string builder. - Optimize
AppendJSON
for[]int
,[]string
,[]interface{}
,map[string]string
andmap[string]interface{}
.
- Add the error based on key-value
- Deprecated:
Byter
andMarshalByter
in the sub-packagejson2
are deprecated.