change: rename ws action type

This commit is contained in:
lilong.129
2024-11-11 21:55:20 +08:00
parent a8247b794a
commit d91a7eacf1
2 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -1 +1 @@
v5.0.0+2411112135 v5.0.0+2411112155
+9 -9
View File
@@ -31,12 +31,12 @@ type wsSession struct {
} }
const ( const (
wsOpen ActionType = "open" wsOpen WSActionType = "open"
wsPing ActionType = "ping" wsPing WSActionType = "ping"
wsWriteAndRead ActionType = "wr" wsWriteAndRead WSActionType = "wr"
wsRead ActionType = "r" wsRead WSActionType = "r"
wsWrite ActionType = "w" wsWrite WSActionType = "w"
wsClose ActionType = "close" wsClose WSActionType = "close"
) )
const ( const (
@@ -45,9 +45,9 @@ const (
defaultWriteWait = 5 * time.Second // default timeout 5 seconds for writing control message defaultWriteWait = 5 * time.Second // default timeout 5 seconds for writing control message
) )
type ActionType string type WSActionType string
func (at ActionType) toString() string { func (at WSActionType) toString() string {
switch at { switch at {
case wsOpen: case wsOpen:
return "open new connection" return "open new connection"
@@ -243,7 +243,7 @@ func (s *StepWebSocket) Extract() *StepRequestExtraction {
} }
type WebSocketAction struct { type WebSocketAction struct {
Type ActionType `json:"type" yaml:"type"` Type WSActionType `json:"type" yaml:"type"`
URL string `json:"url" yaml:"url"` URL string `json:"url" yaml:"url"`
Params map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty"` Params map[string]interface{} `json:"params,omitempty" yaml:"params,omitempty"`
Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"` Headers map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`