ICommand增加配置方法,支持覆盖全局配置
This commit is contained in:
@ -10,6 +10,8 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-developer/websocket/config"
|
||||
|
||||
"github.com/go-developer/websocket/message"
|
||||
|
||||
"github.com/go-developer/websocket"
|
||||
@ -64,6 +66,10 @@ func (e exampleCommand) GetCommand() string {
|
||||
return "ping"
|
||||
}
|
||||
|
||||
func (e exampleCommand) GetConfigOption() []config.SetCommandConfig {
|
||||
return []config.SetCommandConfig{config.ClosePushCommandErrorMessage()}
|
||||
}
|
||||
|
||||
func (e exampleCommand) Execute(ctx *context.WSContext, data []byte) error {
|
||||
message.Response(ctx, map[string]interface{}{"ping": "pong"})
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user