Call/BatchCall RPC Hook
client.HookCallContext(callContextConsoleMiddleware)func callContextConsoleMiddleware(f providers.CallFunc) providers.CallFunc {
return func(ctx context.Context, resultPtr interface{}, method string, args ...interface{}) error {
fmt.Printf("request %v %v\n", method, args)
err := f(ctx, resultPtr, method, args...)
j, _ := json.Marshal(resultPtr)
fmt.Printf("response %s\n", j)
return err
}
}client.HookCallContext(A)
client.HookCallContext(B)Last updated
Was this helpful?