whitelist

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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