echo

package
v4.0.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchoServer

type EchoServer struct {
	// contains filtered or unexported fields
}

EchoServer 内置 Echo 服务器,用于测试代理连通性 不依赖外部网络,完全本地化测试

func NewEchoServer

func NewEchoServer(port int) *EchoServer

NewEchoServer 创建 Echo 服务器

func (*EchoServer) IsRunning

func (s *EchoServer) IsRunning() bool

IsRunning 检查是否运行中

func (*EchoServer) Port

func (s *EchoServer) Port() int

Port 返回端口

func (*EchoServer) Start

func (s *EchoServer) Start(ctx context.Context) error

Start 启动服务器

func (*EchoServer) Stats

func (s *EchoServer) Stats() (requests, bytesIn, bytesOut int64)

Stats 返回统计信息

func (*EchoServer) Stop

func (s *EchoServer) Stop(ctx context.Context) error

Stop 停止服务器

func (*EchoServer) URL

func (s *EchoServer) URL() string

URL 返回服务器 URL

type HTTPEchoServer

type HTTPEchoServer struct {
	// contains filtered or unexported fields
}

HTTPEchoServer HTTP Echo 服务器(更简单的版本)

func NewHTTPEchoServer

func NewHTTPEchoServer(port int) *HTTPEchoServer

NewHTTPEchoServer 创建 HTTP Echo 服务器

func (*HTTPEchoServer) Port

func (s *HTTPEchoServer) Port() int

Port 返回端口

func (*HTTPEchoServer) Start

func (s *HTTPEchoServer) Start(ctx context.Context) error

Start 启动服务器

func (*HTTPEchoServer) Stop

func (s *HTTPEchoServer) Stop() error

Stop 停止服务器

func (*HTTPEchoServer) URL

func (s *HTTPEchoServer) URL() string

URL 返回 URL

type TCPEchoServer

type TCPEchoServer struct {
	// contains filtered or unexported fields
}

TCPEchoServer TCP Echo 服务器

func NewTCPEchoServer

func NewTCPEchoServer(port int) *TCPEchoServer

NewTCPEchoServer 创建 TCP Echo 服务器

func (*TCPEchoServer) Addr

func (s *TCPEchoServer) Addr() string

Addr 返回地址

func (*TCPEchoServer) Port

func (s *TCPEchoServer) Port() int

Port 返回端口

func (*TCPEchoServer) Start

func (s *TCPEchoServer) Start(ctx context.Context) error

Start 启动服务器

func (*TCPEchoServer) Stop

func (s *TCPEchoServer) Stop() error

Stop 停止服务器

Jump to

Keyboard shortcuts

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