accept

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loop added in v0.6.0

func Loop(cfg LoopConfig, accept func() error)

Loop 反复调用 accept 直到 listener 被关闭或不可恢复错误发生。 收到 net.ErrClosed 时静默返回;其它错误记一条日志并退出。

Types

type LoopConfig added in v0.6.0

type LoopConfig struct {
	Logger     *slog.Logger
	RetryDelay time.Duration
}

LoopConfig 控制 Loop 的 logger 和重试参数。

Jump to

Keyboard shortcuts

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