server

package
v0.1.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MulanPSL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package server 实现 Pulse UDP 服务端。

Index

Constants

This section is empty.

Variables

View Source
var SessionTailGrace = 10 * time.Second

SessionTailGrace 控制会话主时长结束后的尾包等待时长。

Functions

func Run

func Run(ctx context.Context, port int, listenAddr string, outputRoot string, pcapPlanDir string, statsInterval time.Duration, statsWriter io.Writer, logger *slog.Logger) error

Run 在 ctx 取消或出错前阻塞监听 UDP。 pcapPlanDir 为 PCAP 回放时加载 plan 的目录(默认 plans);空字符串在调用方应已替换为 planpath.DefaultPlanDir。

func TestResolveServerCSVPath_BoundaryCases

func TestResolveServerCSVPath_BoundaryCases(t *testing.T)

测试 resolveServerCSVPath 函数的边界情况

func TestResolveServerCSVPath_DefaultOutputRoot

func TestResolveServerCSVPath_DefaultOutputRoot(t *testing.T)

测试 resolveServerCSVPath 函数的默认输出目录

func TestResolveServerCSVPath_DirectoryCreation

func TestResolveServerCSVPath_DirectoryCreation(t *testing.T)

测试 resolveServerCSVPath 函数的目录创建

func TestRun

func TestRun(t *testing.T)

测试 Run 函数的集成测试

Types

This section is empty.

Source Files

  • server.go
  • server_test_config.go
  • server_test_integration.go
  • udp_stats.go

Jump to

Keyboard shortcuts

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