single

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option[K comparable] func(*Single[K])

Option 配置项

func WithKeyFn

func WithKeyFn[K comparable](fn func(ctx *zero.Ctx) K) Option[K]

WithKeyFn 指定反并发的 Key

func WithPostFn

func WithPostFn[K comparable](fn func(ctx *zero.Ctx)) Option[K]

WithPostFn 指定反并发拦截后的操作

type Single

type Single[K comparable] struct {
	// contains filtered or unexported fields
}

Single 反并发

func New

func New[K comparable](op ...Option[K]) *Single[K]

New 创建反并发中间件

func (*Single[K]) Apply

func (s *Single[K]) Apply(engine *zero.Engine)

Apply 为指定 Engine 添加反并发功能

Jump to

Keyboard shortcuts

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