core

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 LoadConfig(ctx context.Context, quit chan bool)

Types

type BlockNumberResponseData

type BlockNumberResponseData struct {
	JsonRpc string `json:"jsonrpc"`
	ID      int64  `json:"id"`
	Result  string `json:"result"`
}

type Config

type Config 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 HttpUpstream

type HttpUpstream struct {
	// contains filtered or unexported fields
}

type IStrategy

type IStrategy interface {
	// contains filtered or unexported methods
}

type NaiveProxy

type NaiveProxy struct{}

type RaceProxy

type RaceProxy struct{}

type Request

type Request struct {
	// contains filtered or unexported fields
}

type RequestData

type RequestData struct {
	JsonRpc string        `json:"jsonrpc"`
	ID      int64         `json:"id"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

type RunningConfig

type RunningConfig struct {
	Upstreams               []Upstream
	Strategy                IStrategy
	MethodLimitationEnabled bool
	// contains filtered or unexported fields
}

func BuildRunningConfigFromConfig

func BuildRunningConfigFromConfig(parentContext context.Context, cfg *Config) (*RunningConfig, error)

type Server

type Server struct{}

func (*Server) ServeHTTP

func (h *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) ServerWS

func (h *Server) ServerWS(conn *websocket.Conn) error

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL