Documentation ¶
Index ¶
- Constants
- Variables
- func HookMiddlewares(provider *providers.MiddlewarableProvider, url, space string)
- func MustNewCfxClient(url string, options ...ClientOption) *sdk.Client
- func MustNewCfxClientFromViper(options ...ClientOption) *sdk.Client
- func MustNewCfxWsClientFromViper(options ...ClientOption) *sdk.Client
- func MustNewEthClient(url string, options ...ClientOption) *web3go.Client
- func MustNewEthClientFromViper(options ...ClientOption) *web3go.Client
- func NewCfxClient(url string, options ...ClientOption) (*sdk.Client, error)
- func NewEthClient(url string, options ...ClientOption) (*web3go.Client, error)
- func Url2NodeName(url string) string
- type ClientOption
- type ClientOptioner
- type Protocol
- type Server
Constants ¶
View Source
const ( ProtocolHttp = "HTTP" ProtocolWS = "WS" )
Variables ¶
View Source
var ( // DefaultShutdownTimeout is default timeout to shutdown RPC server. DefaultShutdownTimeout = 3 * time.Second )
Functions ¶
func HookMiddlewares ¶
func HookMiddlewares(provider *providers.MiddlewarableProvider, url, space string)
func MustNewCfxClient ¶
func MustNewCfxClient(url string, options ...ClientOption) *sdk.Client
func MustNewCfxClientFromViper ¶
func MustNewCfxClientFromViper(options ...ClientOption) *sdk.Client
func MustNewCfxWsClientFromViper ¶
func MustNewCfxWsClientFromViper(options ...ClientOption) *sdk.Client
func MustNewEthClient ¶
func MustNewEthClient(url string, options ...ClientOption) *web3go.Client
func MustNewEthClientFromViper ¶
func MustNewEthClientFromViper(options ...ClientOption) *web3go.Client
func NewCfxClient ¶
func NewCfxClient(url string, options ...ClientOption) (*sdk.Client, error)
func NewEthClient ¶
func NewEthClient(url string, options ...ClientOption) (*web3go.Client, error)
func Url2NodeName ¶
Types ¶
type ClientOption ¶
type ClientOption func(opt ClientOptioner)
func WithClientHookMetrics ¶
func WithClientHookMetrics(hook bool) ClientOption
func WithClientMaxConnsPerHost ¶
func WithClientMaxConnsPerHost(maxConns int) ClientOption
func WithClientRequestTimeout ¶
func WithClientRequestTimeout(reqTimeout time.Duration) ClientOption
func WithClientRetryCount ¶
func WithClientRetryCount(retry int) ClientOption
func WithClientRetryInterval ¶
func WithClientRetryInterval(retryInterval time.Duration) ClientOption
type ClientOptioner ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves JSON RPC services.
func MustNewServer ¶
func MustNewServer(name string, rpcs map[string]interface{}, middlewares ...handlers.Middleware) *Server
MustNewServer creates an instance of Server with specified RPC services.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.