MCPcopy Create free account
hub / github.com/DNAProject/DNA / HandleFunc

Function HandleFunc

http/base/rpc/rpc.go:54–58  ·  view source on GitHub ↗

a function to register functions to be called for specific rpc calls

(pattern string, handler func([]interface{}) map[string]interface{})

Source from the content-addressed store, hash-verified

52
53//a function to register functions to be called for specific rpc calls
54func HandleFunc(pattern string, handler func([]interface{}) map[string]interface{}) {
55 mainMux.Lock()
56 defer mainMux.Unlock()
57 mainMux.m[pattern] = handler
58}
59
60//a function to be called if the request is not a HTTP JSON RPC call
61func SetDefaultFunc(def func(http.ResponseWriter, *http.Request)) {

Callers 2

StartLocalServerFunction · 0.92
StartRPCServerFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected