Skip to content

Commit

Permalink
enhance: [2.5] Cherry-pick proto change from master (#384)
Browse files Browse the repository at this point in the history
* Support push info to hook (#369)

Signed-off-by: aoiasd <[email protected]>
Signed-off-by: Congqi Xia <[email protected]>

* Add request time for describe collection (#359)

Signed-off-by: Cai Zhang <[email protected]>
Signed-off-by: Congqi Xia <[email protected]>

---------

Signed-off-by: aoiasd <[email protected]>
Signed-off-by: Congqi Xia <[email protected]>
Signed-off-by: Cai Zhang <[email protected]>
Co-authored-by: aoiasd <[email protected]>
Co-authored-by: cai.zhang <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2024
1 parent c18fc42 commit 66c87c7
Show file tree
Hide file tree
Showing 3 changed files with 2,478 additions and 2,456 deletions.
13 changes: 12 additions & 1 deletion go-api/hook/hook.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package hook

import "context"
import (
"context"
)

type Hook interface {
Init(params map[string]string) error
Expand All @@ -11,6 +13,15 @@ type Hook interface {
Release()
}

type LogInfo interface {
GetFields(fields []string) map[string]any
}

type Extension interface {
Report(info any) int
ReportRefused(ctx context.Context, req interface{}, resp interface{}, err error, fullMethod string) error
}

type HookContextKeyType string

const GinParamsKey = HookContextKeyType("gin_params")
Loading

0 comments on commit 66c87c7

Please sign in to comment.