-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(gateway): reorganize helper functions into separate files an…
…d remove unused code The changes include: - Move `client.go`, `grpc.go`, `header.go`, `http.go`, `log.go`, and `trace.go` into separate files for better organization - Remove `middlewares.go` as it is no longer used - Refactor `trace.go` to use a single function `WithTraceHeader` to extract trace headers from a request header and set them in a context - Refactor `trace.go` to use a string key instead of a custom type for trace context keys - Refactor `trace.go` to use `strings.TrimSpace` to remove leading/trailing spaces from trace header values before setting them in a context - Refactor `trace.go` to use `traceContextKey` type directly instead of defining separate constants for each header key - Refactor `trace.go` to use `ExtractTraceHeader` and `Set feat(utils.go): add functions to convert span context to and from binary format feat(utils.go): add function to generate new random span ID feat(utils.go): add function to convert span context from W3C trace context header feat(http.go): add /gateway endpoint to forward requests to integration service refactor(http.go): use new client middleware functions for tracing and logging in NewHTTPServer function
- Loading branch information
1 parent
d181a3d
commit 66c9d1e
Showing
12 changed files
with
434 additions
and
152 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 was deleted.
Oops, something went wrong.
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,19 @@ | ||
package helpers | ||
|
||
const ( | ||
traceParentHeader = "traceparent" | ||
traceStateHeader = "tracestate" | ||
grpcTraceBinHeader = "grpc-trace-bin" | ||
) | ||
|
||
type HeaderGetter interface { | ||
Get(key string) string | ||
} | ||
|
||
type HeaderSetter interface { | ||
Set(key, value string) | ||
} | ||
|
||
func SetAppIdHeader(headers HeaderSetter, appID string) { | ||
headers.Set("dapr-app-id", appID) | ||
} |
Oops, something went wrong.