Skip to content

Commit

Permalink
Support push info to hook (#369)
Browse files Browse the repository at this point in the history
Signed-off-by: aoiasd <[email protected]>
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
aoiasd authored and congqixia committed Dec 20, 2024
1 parent c18fc42 commit 1446d9d
Showing 1 changed file with 12 additions and 1 deletion.
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")

0 comments on commit 1446d9d

Please sign in to comment.