interceptor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(interceptors []kod.Interceptor) kod.Interceptor

Chain converts a slice of Interceptors into a single Interceptor.

func If

func If(interceptor kod.Interceptor, condition Condition) kod.Interceptor

If returns an Interceptor that only invokes the given interceptor if the given condition is true.

Types

type Condition

type Condition func(ctx context.Context, info kod.CallInfo) bool

Condition is the type of the function used to determine whether an interceptor should be used.

func And

func And(first, second Condition, conditions ...Condition) Condition

And groups conditions with the AND operator.

func IsMethod

func IsMethod(method string) Condition

IsMethod returns a condition that checks if the method name matches the given method.

func Not

func Not(condition Condition) Condition

Not negates the given condition.

func Or

func Or(first, second Condition, conditions ...Condition) Condition

Or groups conditions with the OR operator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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