steem

package
v0.0.0-...-d8d59cd Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeUnknownMethod = iota
	CodeDecodingError
	CodeHandlerUndefined
	CodeInvalidArguments
	CodeHandlerError
)

Variables

View Source
var ErrInvalidArguments = errs.New("invalid arguments")

Functions

This section is empty.

Types

type MockRPCServer

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

MockRPCServer can be used to mock requests to the steemd RPC endpoint.

func NewMockRPCServer

func NewMockRPCServer(logger *zap.Logger) *MockRPCServer

NewMockRPCServer returns a new steemd RPC mock server.

func (*MockRPCServer) Handle

func (server *MockRPCServer) Handle(ctx context.Context, conn *jsonrpc2.Conn, r *jsonrpc2.Request)

Handle implements jsonrpc2.Handler.

func (*MockRPCServer) HandleRPC

func (server *MockRPCServer) HandleRPC(
	apiID int,
	method string,
	handler RPCHandlerFunc,
)

HandleRPC can be used to register a handler function to be used to handle the given combination of API ID and method name.

func (*MockRPCServer) ServeHTTP

func (server *MockRPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves HTTP requests by upgrading to WebSocket and serving steemd RPC endpoint requests as specified.

type RPCHandlerFunc

type RPCHandlerFunc func(apiID int, method string, args []*json.RawMessage) (interface{}, error)

RPCHandlerFunc is a function that is used to handle incoming RPC requests.

Jump to

Keyboard shortcuts

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