Skip to content

Commit

Permalink
Support push info to hook
Browse files Browse the repository at this point in the history
Signed-off-by: aoiasd <[email protected]>
  • Loading branch information
aoiasd committed Nov 29, 2024
1 parent 93892e6 commit 9c8fbfd
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 9c8fbfd

Please sign in to comment.