X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=net%2Fwebsocket%2Fwsjson.go;fp=net%2Fwebsocket%2Fwsjson.go;h=0000000000000000000000000000000000000000;hp=5515be0d8a14f7a10b4ce014ef07cbaf75ec2661;hb=d09b7a78d44dc259725902b8141cdba0d716b121;hpb=ee01d543fdfe1fd0a4d548965c66f7923ea7b062 diff --git a/net/websocket/wsjson.go b/net/websocket/wsjson.go deleted file mode 100644 index 5515be0d..00000000 --- a/net/websocket/wsjson.go +++ /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 -}