diff options
| author | Shulhan <ms@kilabit.info> | 2021-03-21 04:32:03 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-03-21 04:32:03 +0700 |
| commit | 524962c1c8e26cec26fa356719ed990a4a4c82f1 (patch) | |
| tree | e12b2ffd4e22319418b56c8cc0d9c029439f06d4 | |
| parent | 05474abb07f73aace79bcf339be8e5619dd4564b (diff) | |
| download | gorankusu-524962c1c8e26cec26fa356719ed990a4a4c82f1.tar.xz | |
all: remove unused request and WebSocketTarget types
The request type has been replaced with RunRequest.
The WebSocketTarget may be used again later, but let remove then now
to make the documentation clear.
| -rw-r--r-- | request.go | 21 | ||||
| -rw-r--r-- | websocket_target.go | 41 |
2 files changed, 0 insertions, 62 deletions
diff --git a/request.go b/request.go deleted file mode 100644 index 60ba48a..0000000 --- a/request.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2021, Shulhan <ms@kilabit.info>. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package trunks - -import "encoding/json" - -// -// request represent generic request. -// -type request struct { - Env *Environment - Target *HttpTarget - WebSocketTarget *WebSocketTarget - Result *loadTestingResult -} - -func (req *request) unpack(b []byte) error { - return json.Unmarshal(b, req) -} diff --git a/websocket_target.go b/websocket_target.go deleted file mode 100644 index 2353bc3..0000000 --- a/websocket_target.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2021, Shulhan <ms@kilabit.info>. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package trunks - -import ( - "strings" - - "github.com/shuLhan/share/lib/ascii" -) - -type websocketRunHandler func(wstarget *WebSocketTarget, req *request) ([]byte, error) - -type WebSocketTarget struct { - ID string - Name string - Status string - Params map[string]string - - // connectPath define the path on server where connection should be - // open, for example "/" or "/ws". - connectPath string - reqMethod string - reqTarget string - - // runHandler define a function that will be called to run the test. - runHandler websocketRunHandler -} - -func (wstarget *WebSocketTarget) init() { - if len(wstarget.ID) == 0 { - name := []byte(strings.ToLower(wstarget.Name)) - for x := 0; x < len(name); x++ { - if !ascii.IsAlnum(name[x]) { - name[x] = '_' - } - } - wstarget.ID = string(name) - } -} |
