mirror of
https://github.com/nabbar/golib.git
synced 2025-10-05 15:56:50 +08:00
Package Socket:
- fix tcp,udp,unix socket - add socket unixgram for session less unix socket - optmize process & code - add some standalone test for server / client (add example server config for rsyslog) Package Network/Protocol: - add unixgram protocol Package Errors: - fix bug in loop to prevent circular include
This commit is contained in:
@@ -46,6 +46,7 @@ const (
|
||||
NetworkIP
|
||||
NetworkIP4
|
||||
NetworkIP6
|
||||
NetworkUnixGram
|
||||
)
|
||||
|
||||
func Parse(str string) NetworkProtocol {
|
||||
@@ -60,6 +61,8 @@ func Parse(str string) NetworkProtocol {
|
||||
return NetworkUDP
|
||||
case strings.EqualFold(NetworkUnix.Code(), str):
|
||||
return NetworkUnix
|
||||
case strings.EqualFold(NetworkUnixGram.Code(), str):
|
||||
return NetworkUnixGram
|
||||
default:
|
||||
return NetworkEmpty
|
||||
}
|
||||
|
Reference in New Issue
Block a user