server

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHTTPServerNotReady 表示本地 HTTP-01 服务尚未成功监听端口。
	ErrHTTPServerNotReady = errors.New("HTTP-01 服务尚未启动")
)

Functions

This section is empty.

Types

type ChallengeCache

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

ChallengeCache 存储 ACME challenge token 和 response 的映射

func (*ChallengeCache) CleanExpired

func (c *ChallengeCache) CleanExpired()

CleanExpired 清理所有过期的 challenge

func (*ChallengeCache) CountActive added in v0.6.0

func (c *ChallengeCache) CountActive() int

CountActive 返回当前未过期的 challenge 数量。

func (*ChallengeCache) DebugChallenges added in v0.6.0

func (c *ChallengeCache) DebugChallenges() []debugChallengeInfo

DebugChallenges 返回当前有效 challenge 的脱敏调试信息。

func (*ChallengeCache) Delete

func (c *ChallengeCache) Delete(token string)

Delete 删除 challenge

func (*ChallengeCache) Get

func (c *ChallengeCache) Get(token string) (string, bool)

Get 获取 challenge response

func (*ChallengeCache) GetDomain

func (c *ChallengeCache) GetDomain(token string) (string, bool)

GetDomain 获取 token 对应的域名

func (*ChallengeCache) Set

func (c *ChallengeCache) Set(token, response, domain string, ttl time.Duration)

Set 设置 challenge,带过期时间

type HTTPServer

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

HTTPServer HTTP-01 验证服务器

func NewHTTPServer

func NewHTTPServer(port int) *HTTPServer

NewHTTPServer 使用显式端口创建 HTTP-01 服务器,端口 0 仅供测试自动分配。

func (*HTTPServer) IsReady added in v0.6.2

func (s *HTTPServer) IsReady() bool

IsReady 判断 HTTP-01 服务是否已经成功监听端口。

func (*HTTPServer) RemoveChallenge

func (s *HTTPServer) RemoveChallenge(token string) error

RemoveChallenge 精确移除 challenge token。

func (*HTTPServer) SetChallenge

func (s *HTTPServer) SetChallenge(token, response, domain string) error

SetChallenge 设置 challenge token 和 response,10 分钟后过期。

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start 启动 HTTP 服务器

func (*HTTPServer) Stop

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

Stop 停止 HTTP 服务器

Jump to

Keyboard shortcuts

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