This commit is contained in:
crusader 2017-08-28 16:59:22 +09:00
parent 24629d21f6
commit 38206e9718

View File

@ -5,8 +5,8 @@ import (
)
type (
OnRequestFunc func(soc gws.Socket, method string, params interface{}) (interface{}, error)
OnNotifyFunc func(soc gws.Socket, method string, params interface{}) error
OnRequestFunc func(soc gws.Socket, method string, params []string) (interface{}, error)
OnNotifyFunc func(soc gws.Socket, method string, params []string) error
)
// ClientOptions is configuration of the websocket server
@ -18,13 +18,13 @@ type Options struct {
// Validate validates the configuration
func (o *Options) Validate() *Options {
if o.OnRequest == nil {
o.OnRequest = func(soc gws.Socket, method string, params interface{}) (interface{}, error) {
o.OnRequest = func(soc gws.Socket, method string, params []string) (interface{}, error) {
return nil, nil
}
}
if o.OnNotify == nil {
o.OnNotify = func(soc gws.Socket, method string, params interface{}) error {
o.OnNotify = func(soc gws.Socket, method string, params []string) error {
return nil
}
}