hookutil

package
v0.10.3-0...-930112e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OpTypeKey          = "op_type"
	DatabaseKey        = "database"
	UsernameKey        = "username"
	RequestDataSizeKey = "request_data_size"
	ResultDataSizeKey  = "result_data_size"
	RelatedDataSizeKey = "related_data_size"
	SuccessCntKey      = "success_cnt"
	FailCntKey         = "fail_cnt"
	RelatedCntKey      = "related_cnt"
	NodeIDKey          = "id"

	OpTypeInsert       = "insert"
	OpTypeDelete       = "delete"
	OpTypeUpsert       = "upsert"
	OpTypeQuery        = "query"
	OpTypeSearch       = "search"
	OpTypeHybridSearch = "hybrid_search"
	OpTypeNodeID       = "node_id"
)

Functions

func GetExtension

func GetExtension() hook.Extension

GetHook returns singleton hook.Extension instance.

func GetHook

func GetHook() hook.Hook

GetHook returns singleton hook.Hook instance.

func InitOnceHook

func InitOnceHook()

Types

type DefaultExtension

type DefaultExtension struct{}

func (DefaultExtension) Report

func (d DefaultExtension) Report(info any) int

type DefaultHook

type DefaultHook struct{}

func (DefaultHook) After

func (d DefaultHook) After(ctx context.Context, result interface{}, err error, fullMethod string) error

func (DefaultHook) Before

func (d DefaultHook) Before(ctx context.Context, req interface{}, fullMethod string) (context.Context, error)

func (DefaultHook) Init

func (d DefaultHook) Init(params map[string]string) error

func (DefaultHook) Mock

func (d DefaultHook) Mock(ctx context.Context, req interface{}, fullMethod string) (bool, interface{}, error)

func (DefaultHook) Release

func (d DefaultHook) Release()

func (DefaultHook) VerifyAPIKey

func (d DefaultHook) VerifyAPIKey(key string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL