prysm-pulse/beacon-chain/rpc/apimiddleware/endpoint_factory.go
Radosław Kapka 6a638bd148
HTTP handler for Beacon API events (#13207)
* in progress

* implementation done

* bzl

* fixes

* tests in progress

* tests

* go mod tidy

* Update beacon-chain/rpc/eth/events/events.go

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>

* fix config test

* fix unreachable code issue

* remove proto service dir

* test fix

---------

Co-authored-by: Sammy Rosso <15244892+saolyn@users.noreply.github.com>
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
2023-11-28 23:20:02 +00:00

26 lines
689 B
Go

package apimiddleware
import (
"github.com/prysmaticlabs/prysm/v4/api/gateway/apimiddleware"
)
// BeaconEndpointFactory creates endpoints used for running beacon chain API calls through the API Middleware.
type BeaconEndpointFactory struct {
}
func (f *BeaconEndpointFactory) IsNil() bool {
return f == nil
}
// Paths is a collection of all valid beacon chain API paths.
func (_ *BeaconEndpointFactory) Paths() []string {
return []string{}
}
// Create returns a new endpoint for the provided API path.
func (_ *BeaconEndpointFactory) Create(path string) (*apimiddleware.Endpoint, error) {
endpoint := apimiddleware.DefaultEndpoint()
endpoint.Path = path
return &endpoint, nil
}