Documentation ¶
Overview ¶
Package network contains useful functions for ip address formatting.
Index ¶
- Constants
- func ExternalIP() (string, error)
- func ExternalIPv4() (string, error)
- func IPAddr() net.IP
- func Method(auth string) authorization.Method
- func NewExecutionRPCClient(ctx context.Context, endpoint Endpoint, headers http.Header) (*gethRPC.Client, error)
- func NewHttpClientWithSecret(secret, id string) *http.Client
- func SortAddresses(ipAddrs []net.IP) []net.IP
- type AuthorizationData
- type Endpoint
Constants ¶
const DefaultRPCHTTPTimeout = time.Second * 30
DefaultRPCHTTPTimeout for HTTP requests via an RPC connection to an execution node.
Variables ¶
This section is empty.
Functions ¶
func ExternalIP ¶
ExternalIP returns the first IPv4/IPv6 available.
func ExternalIPv4 ¶
ExternalIPv4 returns the first IPv4 available.
func Method ¶
func Method(auth string) authorization.Method
Method returns the authorizationmethod.AuthorizationMethod corresponding with the parameter value.
func NewExecutionRPCClient ¶
func NewHttpClientWithSecret ¶
NewHttpClientWithSecret returns a http client that utilizes jwt authentication.
Types ¶
type AuthorizationData ¶
type AuthorizationData struct { Method authorization.Method Value string JwtId string }
AuthorizationData holds all information necessary to authorize with HTTP.
func (*AuthorizationData) Equals ¶
func (d *AuthorizationData) Equals(other AuthorizationData) bool
Equals compares two authorization data objects for equality.
func (*AuthorizationData) ToHeaderValue ¶
func (d *AuthorizationData) ToHeaderValue() (string, error)
ToHeaderValue retrieves the value of the authorization header from AuthorizationData.
type Endpoint ¶
type Endpoint struct { Url string Auth AuthorizationData }
Endpoint is an endpoint with authorization data.
func HttpEndpoint ¶
HttpEndpoint extracts an httputils.Endpoint from the provider parameter.
func (Endpoint) HttpClient ¶
HttpClient creates a http client object dependent on the properties of the network endpoint.
Directories ¶
Path | Synopsis |
---|---|
Package forks contains useful helpers for Ethereum consensus fork-related functionality.
|
Package forks contains useful helpers for Ethereum consensus fork-related functionality. |