Documentation ¶
Index ¶
- Constants
- Variables
- func Count(key string)
- func Handler() http.Handler
- func LoadConfig(ctx context.Context, quit chan bool)
- func StartMonitorHttpServer(ctx context.Context)
- func Time(key string, value float64)
- func Value(key string, value float64)
- type BlockNumberResponseData
- type ChainConfig
- type Config
- type FallbackProxy
- type FallbackStatus
- type HealthInfo
- type HttpUpstream
- type IStrategy
- type JsonRpcError
- type JsonRpcResponse
- type LoadBalanceFallbackProxy
- type NaiveProxy
- type NodeInfo
- type RaceProxy
- type ReqCacheKey
- type Request
- type RequestData
- type RunningChainConfig
- type RunningConfig
- type Server
- type Upstream
- type WsUpstream
Constants ¶
View Source
const CacheSize = 2000
Variables ¶
View Source
var AllUpstreamsFailedError = fmt.Errorf("all upstream requests are failed")
View Source
var DecodeError = fmt.Errorf("decode error")
View Source
var DeniedContract = fmt.Errorf("not allowed contract or address")
View Source
var DeniedMethod = fmt.Errorf("not allowed method")
View Source
var TimeoutError = fmt.Errorf("timeout error")
Functions ¶
func LoadConfig ¶
func StartMonitorHttpServer ¶
Types ¶
type BlockNumberResponseData ¶
type ChainConfig ¶
type ChainConfig struct { Upstreams []string `json:"upstreams"` OldTrieUrl string `json:"oldTrieUrl"` Strategy string `json:"strategy"` MethodLimitationEnabled bool `json:"methodLimitationEnabled"` AllowedMethods []string `json:"allowedMethods"` ContractWhitelist []string `json:"contractWhitelist"` }
type FallbackProxy ¶
type FallbackProxy struct {
// contains filtered or unexported fields
}
type FallbackStatus ¶
type FallbackStatus struct {
// contains filtered or unexported fields
}
type HealthInfo ¶
type HttpUpstream ¶
type HttpUpstream struct {
// contains filtered or unexported fields
}
type JsonRpcError ¶
type JsonRpcResponse ¶
type JsonRpcResponse struct { JsonRpc string `json:"jsonrpc"` ID int64 `json:"id"` Err JsonRpcError `json:"error"` Result interface{} `json:"result"` }
type LoadBalanceFallbackProxy ¶
type LoadBalanceFallbackProxy struct {
// contains filtered or unexported fields
}
type NaiveProxy ¶
type NaiveProxy struct{}
type ReqCacheKey ¶
type ReqCacheKey struct { ChainId uint64 `json:"chainId"` RequestData }
type RequestData ¶
type RunningChainConfig ¶
type RunningConfig ¶
type RunningConfig struct { Configs map[uint64]*RunningChainConfig // contains filtered or unexported fields }
func BuildRunningConfigFromConfig ¶
func BuildRunningConfigFromConfig(parentContext context.Context, cfg *Config) (*RunningConfig, error)
func NewRunningConfig ¶
func NewRunningConfig(ctx context.Context, cfg *Config) (*RunningConfig, error)
type Server ¶
type Server struct{}
type Upstream ¶
type Upstream interface {
// contains filtered or unexported methods
}
the handle function will execute concurrently
type WsUpstream ¶
type WsUpstream struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.