Skip to content

Commit c60fb80

Browse files
committed
Support push info to hook (#369)
Signed-off-by: aoiasd <[email protected]>
1 parent 7f744ed commit c60fb80

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

go-api/hook/hook.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package hook
22

3-
import "context"
3+
import (
4+
"context"
5+
)
46

57
type Hook interface {
68
Init(params map[string]string) error
@@ -11,6 +13,15 @@ type Hook interface {
1113
Release()
1214
}
1315

16+
type LogInfo interface {
17+
GetFields(fields []string) map[string]any
18+
}
19+
1420
type Extension interface {
1521
Report(info any) int
22+
ReportRefused(ctx context.Context, req interface{}, resp interface{}, err error, fullMethod string) error
1623
}
24+
25+
type HookContextKeyType string
26+
27+
const GinParamsKey = HookContextKeyType("gin_params")

0 commit comments

Comments
 (0)