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) 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.
Click to show internal directories.
Click to hide internal directories.