ing
This commit is contained in:
parent
fc21d7dfa2
commit
ac4646131b
|
@ -1,6 +1,8 @@
|
|||
package server
|
||||
|
||||
type ServerHandler interface {
|
||||
ConnectionHandler
|
||||
|
||||
GetName() string
|
||||
ServerCtx() ServerCtx
|
||||
|
||||
|
@ -13,6 +15,8 @@ type ServerHandler interface {
|
|||
}
|
||||
|
||||
type ServerHandlers struct {
|
||||
ConnectionHandlers
|
||||
|
||||
// Server name for sending in response headers.
|
||||
//
|
||||
// Default server name is used if left blank.
|
||||
|
@ -44,6 +48,10 @@ func (sh *ServerHandlers) GetName() string {
|
|||
}
|
||||
|
||||
func (sh *ServerHandlers) Validate() error {
|
||||
if err := sh.ConnectionHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
|
||||
if "" == sh.Name {
|
||||
sh.Name = "Server"
|
||||
}
|
||||
|
|
|
@ -6,13 +6,11 @@ import (
|
|||
|
||||
type ServerHandler interface {
|
||||
server.ServerHandler
|
||||
server.ConnectionHandler
|
||||
ReadWriteHandler
|
||||
}
|
||||
|
||||
type ServerHandlers struct {
|
||||
server.ServerHandlers
|
||||
server.ConnectionHandlers
|
||||
ReadWriteHandlers
|
||||
}
|
||||
|
||||
|
@ -20,9 +18,6 @@ func (sh *ServerHandlers) Validate() error {
|
|||
if err := sh.ServerHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
if err := sh.ConnectionHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
if err := sh.ReadWriteHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -6,13 +6,11 @@ import (
|
|||
|
||||
type ServerHandler interface {
|
||||
server.ServerHandler
|
||||
server.ConnectionHandler
|
||||
server.ReadWriteHandler
|
||||
}
|
||||
|
||||
type ServerHandlers struct {
|
||||
server.ServerHandlers
|
||||
server.ConnectionHandlers
|
||||
server.ReadWriteHandlers
|
||||
}
|
||||
|
||||
|
@ -20,9 +18,6 @@ func (sh *ServerHandlers) Validate() error {
|
|||
if err := sh.ServerHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
if err := sh.ConnectionHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
if err := sh.ReadWriteHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user