whitelist

package
v0.0.0-...-3b2d471 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientIPFromRequest

func GetClientIPFromRequest(r *http.Request) string

func GetInvalidIPErrorMsg

func GetInvalidIPErrorMsg(reqByte []byte) ([]byte, error)

GetInvalidIPErrorMsg return `Method not supported` (code=-32004) if invalid. Reference: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md

func IsIPValid

func IsIPValid(ip string) bool

IsIPValid checks if the debugger IP is in the whitelist through the whitelist backend

Types

type InvalidIPErrMsg

type InvalidIPErrMsg struct {
	Code    int64  `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type InvalidIPRespPayload

type InvalidIPRespPayload struct {
	ID      interface{}     `json:"id,omitempty"`
	JsonRPC string          `json:"jsonrpc,omitempty"`
	Method  string          `json:"method,omitempty"`
	Error   InvalidIPErrMsg `json:"error,omitempty"`
}

type ReqPayload

type ReqPayload struct {
	ID      interface{} `json:"id,omitempty"`
	JsonRPC string      `json:"jsonrpc,omitempty"`
	Method  string      `json:"method,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL