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