-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor state query access (#1766)
* refactor state query access * remove direct usage of client.Context to allow the rewiring of lava over lava * refactor rpcconsumer, allow creating a server with a function * lint * added custom lava transport
- Loading branch information
1 parent
ad24517
commit fcfbef4
Showing
14 changed files
with
320 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package rpcconsumer | ||
|
||
import ( | ||
"net/http" | ||
) | ||
|
||
type CustomLavaTransport struct { | ||
transport http.RoundTripper | ||
} | ||
|
||
func NewCustomLavaTransport(httpTransport http.RoundTripper) *CustomLavaTransport { | ||
return &CustomLavaTransport{transport: httpTransport} | ||
} | ||
|
||
func (c *CustomLavaTransport) RoundTrip(req *http.Request) (*http.Response, error) { | ||
// Custom logic before the request | ||
|
||
// Delegate to the underlying RoundTripper (usually http.Transport) | ||
resp, err := c.transport.RoundTrip(req) | ||
|
||
// Custom logic after the request | ||
return resp, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.