oapi

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

package oapi primarily provides executors for Ethereum 2.0 API operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient added in v0.2.0

func GetClient(ctx context.Context) *eth2spec.APIClient

GetClient returns an *eth2spec.APIClient from the provided context, if one exists in the context.

func WithClient added in v0.2.0

func WithClient(ctx context.Context, target url.URL) context.Context

WithClient returns a context with an OAPI client (accessible using GetClient) which can conduct operations against the provided target.

Types

type ExecGetBeaconStatesCommitteesOpts

type ExecGetBeaconStatesCommitteesOpts struct {
	StateId     string
	Epoch       string
	QueryParams map[string]string
}

type ExecGetValidatorBlocksOpts added in v0.3.0

type ExecGetValidatorBlocksOpts struct {
	Slot        string
	QueryParams map[string]string
}

type ExecGetValidatorDutiesAttesterOpts added in v0.3.0

type ExecGetValidatorDutiesAttesterOpts struct {
	Epoch       string
	QueryParams map[string]string
}

type ExecutorResult

type ExecutorResult struct {
	// Response is an instantiated OAPI data structure of the type returned
	// by the executor for a function's route.
	Response interface{}
	// ResponseDS (DS = Data Structure) is an empty OAPI data structure of
	// the type returned by the executor for a function's route. Properly
	// encoded expected responses can be unmarshaled into this struct. This
	// struct can be marshaled into a canonical JSON encoding to compare
	// against the actual response.
	ResponseDS interface{}
	// StatusCode is the HTTP status code returned for the operation executed
	// by the function. It can be used to compare against expected status
	// code results.
	StatusCode *int
}

ExecutorResult is the first element in the uniform tuple returned by all oapi executor functions.

func ExecGetBeaconBlock

func ExecGetBeaconBlock(ctx context.Context, blockId string) (*ExecutorResult, error)

func ExecGetBeaconBlockAttestations

func ExecGetBeaconBlockAttestations(ctx context.Context, blockId string) (*ExecutorResult, error)

func ExecGetBeaconBlockRoot

func ExecGetBeaconBlockRoot(ctx context.Context, blockId string) (*ExecutorResult, error)

func ExecGetBeaconGenesis

func ExecGetBeaconGenesis(ctx context.Context) (*ExecutorResult, error)

func ExecGetBeaconHeader

func ExecGetBeaconHeader(ctx context.Context, blockId string) (*ExecutorResult, error)

func ExecGetBeaconHeaders

func ExecGetBeaconHeaders(ctx context.Context, queryParams map[string]string) (*ExecutorResult, error)

func ExecGetBeaconStatesFinalityCheckpoints

func ExecGetBeaconStatesFinalityCheckpoints(ctx context.Context, stateId string) (*ExecutorResult, error)

func ExecGetBeaconStatesFork

func ExecGetBeaconStatesFork(ctx context.Context, stateId string) (*ExecutorResult, error)

func ExecGetBeaconStatesRoot

func ExecGetBeaconStatesRoot(ctx context.Context, stateId string) (*ExecutorResult, error)

func ExecGetBeaconStatesValidator

func ExecGetBeaconStatesValidator(ctx context.Context, stateId, validatorId string) (*ExecutorResult, error)

func ExecGetBeaconStatesValidators

func ExecGetBeaconStatesValidators(ctx context.Context, stateId string, queryParams map[string]string) (*ExecutorResult, error)

func ExecGetConfigDepositContract added in v0.3.0

func ExecGetConfigDepositContract(ctx context.Context) (*ExecutorResult, error)

func ExecGetConfigForkSchedule added in v0.3.0

func ExecGetConfigForkSchedule(ctx context.Context) (*ExecutorResult, error)

func ExecGetConfigSpec added in v0.3.0

func ExecGetConfigSpec(ctx context.Context) (*ExecutorResult, error)

func ExecGetDebugBeaconHeads added in v0.3.0

func ExecGetDebugBeaconHeads(ctx context.Context) (*ExecutorResult, error)

func ExecGetDebugBeaconStates added in v0.3.0

func ExecGetDebugBeaconStates(ctx context.Context, stateId string) (*ExecutorResult, error)

func ExecGetNodeHealth

func ExecGetNodeHealth(ctx context.Context) (*ExecutorResult, error)

func ExecGetNodeIdentity

func ExecGetNodeIdentity(ctx context.Context) (*ExecutorResult, error)

func ExecGetNodePeer

func ExecGetNodePeer(ctx context.Context, peerId string) (*ExecutorResult, error)

func ExecGetNodePeers

func ExecGetNodePeers(ctx context.Context) (*ExecutorResult, error)

func ExecGetNodeSyncing

func ExecGetNodeSyncing(ctx context.Context) (*ExecutorResult, error)

func ExecGetNodeVersion

func ExecGetNodeVersion(ctx context.Context) (*ExecutorResult, error)

func ExecGetValidatorAggregateAttestation added in v0.3.0

func ExecGetValidatorAggregateAttestation(
	ctx context.Context,
	queryParams map[string]string) (*ExecutorResult, error)

func ExecGetValidatorAttestationData added in v0.3.0

func ExecGetValidatorAttestationData(
	ctx context.Context,
	queryParams map[string]string) (*ExecutorResult, error)

func ExecGetValidatorBlocks added in v0.3.0

func ExecGetValidatorBlocks(
	ctx context.Context,
	opts ExecGetValidatorBlocksOpts) (*ExecutorResult, error)

func ExecGetValidatorDutiesAttester added in v0.3.0

func ExecGetValidatorDutiesAttester(
	ctx context.Context,
	opts ExecGetValidatorDutiesAttesterOpts) (*ExecutorResult, error)

func ExecGetValidatorDutiesProposer added in v0.3.0

func ExecGetValidatorDutiesProposer(ctx context.Context, epoch string) (*ExecutorResult, error)

Jump to

Keyboard shortcuts

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