proxy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const JSONRPC_INTERNAL_ERROR_CODE = -32603
View Source
const JSONRPC_INVALID_REQUEST_ERROR_CODE = -32600
View Source
const JSONRPC_INVALID_REQUEST_PARAMS_ERROR_CODE = -32602
View Source
const JSONRPC_METHOD_NOT_FOUND_ERROR_CODE = -32601
View Source
const JSONRPC_PARSE_ERROR_CODE = -32700
View Source
const JSONRPC_SERVER_ERROR_CODE_START = -32000 // [-32000, -32099]

Variables

This section is empty.

Functions

func CompareJSONIsSame

func CompareJSONIsSame(a *simplejson.Json, b *simplejson.Json) bool

whether json a and json b have the same value

func DigestJSONForEqual

func DigestJSONForEqual(jsonVal *simplejson.Json) string

func MakeJSONRpcErrorResponse

func MakeJSONRpcErrorResponse(id interface{}, code int, message string, data interface{}) ([]byte, error)

func MakeJSONRpcSuccessResponse

func MakeJSONRpcSuccessResponse(id interface{}, result interface{}) ([]byte, error)

func StartServer

func StartServer(config *Config)

TODO: use config's logpath to log file

Types

type Config

type Config struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`

	RequestTimeoutSeconds int `yaml:"request_timeout_seconds"`

	Workers             []string `yaml:"workers"`
	JSONRpcQueryMethods []string `yaml:"jsonrpc_query_methods"`

	LogPath string `yaml:"logpath"`
}

func ReadConfigFromYaml

func ReadConfigFromYaml(yamlConfigFilePath string) (*Config, error)

type WorkerResponse

type WorkerResponse struct {
	Error       error
	Result      []byte
	ResultJSON  *simplejson.Json
	WorkerIndex int
	WorkerUri   string
}

Jump to

Keyboard shortcuts

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