Documentation ¶
Index ¶
- Variables
- func CheckTimeouts(timeouts *rpc.HTTPTimeouts)
- func RegisterApis(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error
- type HealthCheck
- type Server
- type Web3Gateway
- func (srv *Web3Gateway) Close() error
- func (srv *Web3Gateway) GetHTTPEndpoint() (string, error)
- func (srv *Web3Gateway) GetWSEndpoint() (string, error)
- func (srv *Web3Gateway) RegisterAPIs(apis []rpc.API)
- func (srv *Web3Gateway) RegisterHealthChecks(checks []HealthCheck)
- func (srv *Web3Gateway) Start() error
- func (srv *Web3Gateway) Wait()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServerStopped = errors.New("web3 gateway server not started") ErrServerRunning = errors.New("web3 gateway server already running") )
Functions ¶
func CheckTimeouts ¶
func CheckTimeouts(timeouts *rpc.HTTPTimeouts)
CheckTimeouts ensures that timeout values are meaningful.
Types ¶
type HealthCheck ¶
type HealthCheck interface { // Health checks the health of the service. // // This method should return quickly and should avoid performing any blocking operations. Health() error }
HealthCheck is the health checker interface.
type Web3Gateway ¶
type Web3Gateway struct {
// contains filtered or unexported fields
}
Web3Gateway is a container on which services can be registered.
func New ¶
func New(ctx context.Context, conf *conf.GatewayConfig) (*Web3Gateway, error)
New creates a new web3 gateway.
func (*Web3Gateway) Close ¶
func (srv *Web3Gateway) Close() error
Close stops the Web3Gateway Server and releases resources acquired in Web3Gateway Server constructor New.
func (*Web3Gateway) GetHTTPEndpoint ¶
func (srv *Web3Gateway) GetHTTPEndpoint() (string, error)
GetHTTPEndpoint returns the address of HTTP endpoint.
func (*Web3Gateway) GetWSEndpoint ¶
func (srv *Web3Gateway) GetWSEndpoint() (string, error)
GetWSEndpoint returns the address of Websocket endpoint.
func (*Web3Gateway) RegisterAPIs ¶
func (srv *Web3Gateway) RegisterAPIs(apis []rpc.API)
RegisterAPIs registers the APIs a service provides on the server.
func (*Web3Gateway) RegisterHealthChecks ¶
func (srv *Web3Gateway) RegisterHealthChecks(checks []HealthCheck)
RegisterHealthChecks registers the health checks for the /health endpoint.
func (*Web3Gateway) Start ¶
func (srv *Web3Gateway) Start() error
Start Web3Gateway can only be started once.
Click to show internal directories.
Click to hide internal directories.