Cameradar service scans & attacks over WS

This commit is contained in:
Brendan LE GLAUNEC
2017-10-31 11:22:02 +01:00
committed by Brendan Le Glaunec
parent 6ea4f6e123
commit 1dadb93452
4 changed files with 124 additions and 86 deletions
+10 -8
View File
@@ -12,6 +12,8 @@
package jsonrpc2
import "github.com/EtixLabs/cameradar"
// http://www.jsonrpc.org/specification
const (
ParseError = -32700 // Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
@@ -36,18 +38,18 @@ const (
// Request represents a JSONRPC request
type Request struct {
JSONRPC string `json:"jsonrpc" validate:"eq=2.0"`
Method string `json:"method" validate:"required"`
Params string `json:"params" validate:"required"`
ID string `json:"id"`
JSONRPC string `json:"jsonrpc" validate:"eq=2.0"`
Method string `json:"method" validate:"required"`
Params cmrdr.Options `json:"params" validate:"required"`
ID string `json:"id"`
}
// Response represents a JSONRPC response
type Response struct {
JSONRPC string `json:"jsonrpc" validate:"eq=2.0"`
Result string `json:"result"`
Error Error `json:"error"`
ID string `json:"id"`
JSONRPC string `json:"jsonrpc" validate:"eq=2.0"`
Result []cmrdr.Stream `json:"result"`
Error Error `json:"error"`
ID string `json:"id"`
}
// Error represents a JSONRPC response's error