fix: correct method and path for session api activity (#6880)

* fix: correct method and path for session api activity

* fix: correct method and path for session api activity

* fix: correct function name for activity trigger
This commit is contained in:
Stefan Benz
2023-11-22 11:12:23 +01:00
committed by GitHub
parent 76fe032b5f
commit 5fcb5568d7
6 changed files with 58 additions and 13 deletions

View File

@@ -2,6 +2,8 @@ package info
import (
"context"
"google.golang.org/grpc/codes"
)
type activityInfoKey struct{}
@@ -10,6 +12,8 @@ type ActivityInfo struct {
Method string
Path string
RequestMethod string
GRPCStatus codes.Code
HTTPStatus int
}
func (a *ActivityInfo) IntoContext(ctx context.Context) context.Context {
@@ -32,6 +36,7 @@ func (a *ActivityInfo) SetMethod(method string) *ActivityInfo {
a.Method = method
return a
}
func (a *ActivityInfo) SetPath(path string) *ActivityInfo {
a.Path = path
return a
@@ -41,3 +46,13 @@ func (a *ActivityInfo) SetRequestMethod(method string) *ActivityInfo {
a.RequestMethod = method
return a
}
func (a *ActivityInfo) SetGRPCStatus(status codes.Code) *ActivityInfo {
a.GRPCStatus = status
return a
}
func (a *ActivityInfo) SetHTTPStatus(status int) *ActivityInfo {
a.HTTPStatus = status
return a
}