OSDN Git Service

Thanos did someting
[bytom/vapor.git] / net / websocket / wsjson.go
diff --git a/net/websocket/wsjson.go b/net/websocket/wsjson.go
deleted file mode 100644 (file)
index 5515be0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package websocket
-
-// WSRequest means the data structure of the request
-type WSRequest struct {
-       Topic string `json:"topic"`
-}
-
-// NewWSRequest creates a request data object
-func NewWSRequest(topic string) *WSRequest {
-       return &WSRequest{
-               Topic: topic,
-       }
-}
-
-// WSResponse means the returned data structure
-type WSResponse struct {
-       NotificationType string      `json:"notification_type"`
-       Data             interface{} `json:"data"`
-       ErrorDetail      string      `json:"error_detail,omitempty"`
-}
-
-// NewWSResponse creates a return data object
-func NewWSResponse(notificationType string, data interface{}, err error) *WSResponse {
-       wsResp := &WSResponse{
-               NotificationType: notificationType,
-               Data:             data,
-       }
-
-       if err != nil {
-               wsResp.ErrorDetail = err.Error()
-       }
-
-       return wsResp
-}