Documentation
¶
Index ¶
- Variables
- func EpochFromRequest(r *http.Request) (uint64, error)
- func HandleEndpoint[T any](h EndpointHandler[T]) http.HandlerFunc
- func HandleEndpointFunc[T any](h EndpointHandlerFunc[T]) http.HandlerFunc
- func HashFromQueryParams(r *http.Request, name string) (*common.Hash, error)
- func StringFromRequest(r *http.Request, name string) (string, error)
- func StringListFromQueryParams(r *http.Request, name string) ([]string, error)
- func Uint64FromQueryParams(r *http.Request, name string) (*uint64, error)
- type BeaconResponse
- func (b *BeaconResponse) EncodeSSZ(xs []byte) ([]byte, error)
- func (b *BeaconResponse) EncodingSizeSSZ() int
- func (b *BeaconResponse) MarshalJSON() ([]byte, error)
- func (r *BeaconResponse) With(key string, value any) (out *BeaconResponse)
- func (r *BeaconResponse) WithFinalized(finalized bool) (out *BeaconResponse)
- func (r *BeaconResponse) WithOptimistic(optimistic bool) (out *BeaconResponse)
- func (r *BeaconResponse) WithVersion(version clparams.StateVersion) (out *BeaconResponse)
- type EndpointError
- type EndpointHandler
- type EndpointHandlerFunc
- type IntStr
- type SegmentID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Head chainTag = 0 Finalized chainTag = 1 Justified chainTag = 2 Genesis chainTag = 3 )
View Source
var ErrorCantFindBeaconState = errors.New("Could not find beacon state")
View Source
var ErrorSszNotSupported = errors.New("This endpoint does not support SSZ response")
Functions ¶
func HandleEndpoint ¶
func HandleEndpoint[T any](h EndpointHandler[T]) http.HandlerFunc
func HandleEndpointFunc ¶
func HandleEndpointFunc[T any](h EndpointHandlerFunc[T]) http.HandlerFunc
func HashFromQueryParams ¶
func StringListFromQueryParams ¶
decode a list of strings from the query params
Types ¶
type BeaconResponse ¶
type BeaconResponse struct { Data any Finalized *bool Version *clparams.StateVersion ExecutionOptimistic *bool Extra map[string]any }
func NewBeaconResponse ¶
func NewBeaconResponse(data any) *BeaconResponse
func (*BeaconResponse) EncodingSizeSSZ ¶
func (b *BeaconResponse) EncodingSizeSSZ() int
func (*BeaconResponse) MarshalJSON ¶
func (b *BeaconResponse) MarshalJSON() ([]byte, error)
func (*BeaconResponse) With ¶
func (r *BeaconResponse) With(key string, value any) (out *BeaconResponse)
func (*BeaconResponse) WithFinalized ¶
func (r *BeaconResponse) WithFinalized(finalized bool) (out *BeaconResponse)
func (*BeaconResponse) WithOptimistic ¶
func (r *BeaconResponse) WithOptimistic(optimistic bool) (out *BeaconResponse)
func (*BeaconResponse) WithVersion ¶
func (r *BeaconResponse) WithVersion(version clparams.StateVersion) (out *BeaconResponse)
type EndpointError ¶
type EndpointError struct { Code int `json:"code"` Message string `json:"message"` Stacktraces []string `json:"stacktraces,omitempty"` // contains filtered or unexported fields }
func NewEndpointError ¶
func NewEndpointError(code int, err error) *EndpointError
func WrapEndpointError ¶
func WrapEndpointError(err error) *EndpointError
func (EndpointError) Error ¶
func (e EndpointError) Error() string
func (EndpointError) Unwrap ¶
func (e EndpointError) Unwrap() error
func (*EndpointError) WriteTo ¶
func (e *EndpointError) WriteTo(w http.ResponseWriter)
type EndpointHandler ¶
type EndpointHandlerFunc ¶
func (EndpointHandlerFunc[T]) Handle ¶
func (e EndpointHandlerFunc[T]) Handle(w http.ResponseWriter, r *http.Request) (T, error)
Click to show internal directories.
Click to hide internal directories.