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]>
  • Loading branch information
aoiasd authored Dec 2, 2024
1 parent 5d0b095 commit 620d0c3
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 620d0c3

Please sign in to comment.