29 lines
339 B
Go
29 lines
339 B
Go
|
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
|
||
|
}
|