Documentation ¶
Index ¶
- func DeriveRegisteredPath(request *http.Request, ps httprouter.Params) string
- func DoesAccept(accepts []ContentType, input ContentType) bool
- func ValidateContentType(contentType ContentType, accepting []ContentType) error
- func WrappedHandler(log logrus.FieldLogger, metrics *Metrics, ...) httprouter.Handle
- func WriteContentAwareResponse(w http.ResponseWriter, data []byte, contentType ContentType) error
- func WriteErrorResponse(w http.ResponseWriter, msg string, statusCode int) error
- func WriteJSONResponse(w http.ResponseWriter, data []byte) error
- func WriteSSZResponse(w http.ResponseWriter, data []byte) error
- type ContentType
- type ContentTypeResolver
- type ContentTypeResolvers
- type ErrorContainer
- type EthereumSpec
- type Metrics
- type Response
- func NewBadRequestResponse(resolvers ContentTypeResolvers) *Response
- func NewInternalServerErrorResponse(resolvers ContentTypeResolvers) *Response
- func NewNotFoundResponse(resolvers ContentTypeResolvers) *Response
- func NewSuccessResponse(resolvers ContentTypeResolvers) *Response
- func NewUnsupportedMediaTypeResponse(resolvers ContentTypeResolvers) *Response
- type V1GetEthereumNowRequest
- type V1GetEthereumNowResponse
- type V1GetEthereumSpecRequest
- type V1GetEthereumSpecResponse
- type V1GetFrameRequest
- type V1GetFrameResponse
- type V1MetadataListEpochsRequest
- type V1MetadataListEpochsResponse
- type V1MetadataListLabelsRequest
- type V1MetadataListLabelsResponse
- type V1MetadataListNodesRequest
- type V1MetadataListNodesResponse
- type V1MetadataListRequest
- type V1MetadataListResponse
- type V1MetadataListSlotsRequest
- type V1MetadataListSlotsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveRegisteredPath ¶
func DeriveRegisteredPath(request *http.Request, ps httprouter.Params) string
func DoesAccept ¶
func DoesAccept(accepts []ContentType, input ContentType) bool
func ValidateContentType ¶
func ValidateContentType(contentType ContentType, accepting []ContentType) error
func WrappedHandler ¶
func WrappedHandler(log logrus.FieldLogger, metrics *Metrics, handler func(ctx context.Context, r *http.Request, p httprouter.Params, contentType ContentType) (*Response, error)) httprouter.Handle
func WriteContentAwareResponse ¶
func WriteContentAwareResponse(w http.ResponseWriter, data []byte, contentType ContentType) error
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, msg string, statusCode int) error
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, data []byte) error
WriteJSONResponse writes a JSON response to the given writer.
func WriteSSZResponse ¶
func WriteSSZResponse(w http.ResponseWriter, data []byte) error
Types ¶
type ContentType ¶
type ContentType int
const ( ContentTypeUnknown ContentType = iota ContentTypeJSON ContentTypeYAML ContentTypeSSZ )
func DeriveContentType ¶
func DeriveContentType(accept string) ContentType
func NewContentTypeFromRequest ¶
func NewContentTypeFromRequest(r *http.Request) ContentType
func (ContentType) String ¶
func (c ContentType) String() string
type ContentTypeResolver ¶
type ContentTypeResolvers ¶
type ContentTypeResolvers map[ContentType]ContentTypeResolver
type ErrorContainer ¶
type EthereumSpec ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func (Metrics) ObserveRequest ¶
type Response ¶
type Response struct { StatusCode int `json:"status_code"` Headers map[string]string `json:"headers"` ExtraData map[string]interface{} // contains filtered or unexported fields }
func NewBadRequestResponse ¶
func NewBadRequestResponse(resolvers ContentTypeResolvers) *Response
func NewInternalServerErrorResponse ¶
func NewInternalServerErrorResponse(resolvers ContentTypeResolvers) *Response
func NewNotFoundResponse ¶
func NewNotFoundResponse(resolvers ContentTypeResolvers) *Response
func NewSuccessResponse ¶
func NewSuccessResponse(resolvers ContentTypeResolvers) *Response
func NewUnsupportedMediaTypeResponse ¶
func NewUnsupportedMediaTypeResponse(resolvers ContentTypeResolvers) *Response
func (*Response) AddExtraData ¶
func (Response) SetCacheControl ¶
type V1GetEthereumNowRequest ¶
type V1GetEthereumNowRequest struct { }
type V1GetEthereumSpecResponse ¶
type V1GetEthereumSpecResponse struct { NetworkName string `json:"network_name"` Spec EthereumSpec `json:"spec"` }
type V1GetFrameResponse ¶
type V1MetadataListEpochsRequest ¶
type V1MetadataListEpochsRequest struct { Filter *service.FrameFilter `json:"filter"` Pagination *service.PaginationCursor `json:"pagination"` }
type V1MetadataListEpochsResponse ¶
type V1MetadataListEpochsResponse struct { Epochs []phase0.Epoch `json:"epochs"` Pagination *service.PaginationResponse `json:"pagination"` }
type V1MetadataListLabelsRequest ¶
type V1MetadataListLabelsRequest struct { Filter *service.FrameFilter `json:"filter"` Pagination *service.PaginationCursor `json:"pagination"` }
type V1MetadataListLabelsResponse ¶
type V1MetadataListLabelsResponse struct { Labels []string `json:"labels"` Pagination *service.PaginationResponse `json:"pagination"` }
type V1MetadataListNodesRequest ¶
type V1MetadataListNodesRequest struct { Filter *service.FrameFilter `json:"filter"` Pagination *service.PaginationCursor `json:"pagination"` }
type V1MetadataListNodesResponse ¶
type V1MetadataListNodesResponse struct { Nodes []string `json:"nodes"` Pagination *service.PaginationResponse `json:"pagination"` }
type V1MetadataListRequest ¶
type V1MetadataListRequest struct { Filter *service.FrameFilter `json:"filter"` Pagination *service.PaginationCursor `json:"pagination"` }
// Metadata
type V1MetadataListResponse ¶
type V1MetadataListResponse struct { Frames []*types.FrameMetadata `json:"frames"` Pagination *service.PaginationResponse `json:"pagination"` }
type V1MetadataListSlotsRequest ¶
type V1MetadataListSlotsRequest struct { Filter *service.FrameFilter `json:"filter"` Pagination *service.PaginationCursor `json:"pagination"` }
type V1MetadataListSlotsResponse ¶
type V1MetadataListSlotsResponse struct { Slots []phase0.Slot `json:"slots"` Pagination *service.PaginationResponse `json:"pagination"` }
Click to show internal directories.
Click to hide internal directories.