ing
This commit is contained in:
parent
9527a68c71
commit
32230e44c8
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -128,7 +129,7 @@ func handlePacketTCP(host *discoveryM.Host, dp *discoveryM.DiscoveryPort, ports
|
|||
|
||||
p := &discoveryM.Port{
|
||||
PortType: oocmd.PortTypeTCP,
|
||||
PortNumber: json.Number(port),
|
||||
PortNumber: json.Number(strconv.Itoa(port)),
|
||||
}
|
||||
p.Host = host
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -143,7 +144,7 @@ func handlePacketUDP(host *discoveryM.Host, dp *discoveryM.DiscoveryPort, ports
|
|||
|
||||
p := &discoveryM.Port{
|
||||
PortType: oocmd.PortTypeUDP,
|
||||
PortNumber: json.Number(port),
|
||||
PortNumber: json.Number(strconv.Itoa(port)),
|
||||
UDPLayer: udpLayer,
|
||||
}
|
||||
p.Host = host
|
||||
|
|
27
logging.json
27
logging.json
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"level": "debug",
|
||||
"development": true,
|
||||
"disableCaller": true,
|
||||
"disableStacktrace": true,
|
||||
"sampling": {
|
||||
"initial": 100,
|
||||
"thereafter": 100
|
||||
},
|
||||
"encoding": "console",
|
||||
"encoderConfig": {
|
||||
"messageKey": "message",
|
||||
"levelKey": "level",
|
||||
"timeKey": "time",
|
||||
"nameKey": "name",
|
||||
"callerKey": "caller",
|
||||
"stacktraceKey": "stacktrace",
|
||||
"lineEnding": "\n",
|
||||
"levelEncoder": "color",
|
||||
"timeEncoder": "ISO8601",
|
||||
"durationEncoder": "string",
|
||||
"callerEncoder": "full",
|
||||
"nameEncoder": "full"
|
||||
},
|
||||
"outputPaths": ["stdout", "/tmp/logs"],
|
||||
"errorOutputPaths": ["stderr"]
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package server
|
||||
|
||||
import "net"
|
||||
|
||||
func newConn(nconn net.Conn, contentType string) Conn {
|
||||
c := &conn{
|
||||
contentType: contentType,
|
||||
}
|
||||
c.Conn = nconn
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type Conn interface {
|
||||
net.Conn
|
||||
|
||||
GetContentType() string
|
||||
}
|
||||
|
||||
type conn struct {
|
||||
net.Conn
|
||||
|
||||
contentType string
|
||||
}
|
||||
|
||||
func (c *conn) GetContentType() string {
|
||||
return c.contentType
|
||||
}
|
Loading…
Reference in New Issue
Block a user