providers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderHandler

type ProviderHandler interface {
	// 测试连接
	TestConnection() (bool, error)

	// 上传证书
	UploadCertificate(name, cert, key string) error

	// 部署到 对象存储
	DeployToOSS(certID string, domain string) (string, error)

	// 部署到 CDN
	DeployToCDN(certID string, domain string) (string, error)

	// 部署到 DCND
	DeployToDCND(certID string, domain string) (string, error)
}

ProviderHandler 定义了所有提供商的通用接口

type RequestOptions

type RequestOptions struct {
	Method  string            // HTTP 请求方法
	Path    string            // API 路径 (例如: "/v1/resource")
	Query   map[string]string // URL 查询参数
	Body    any               // 请求体 (将被 JSON 编码)
	Headers map[string]string // 自定义请求头
	Timeout time.Duration     // 请求超时时间 (默认: 30s)
	BaseURL string            // 覆盖默认 Base URL
}

RequestOptions HTTP 请求配置选项

type Response

type Response struct {
	StatusCode int            // HTTP 状态码
	Body       map[string]any // 响应体
	Headers    http.Header    // 响应头
}

Response HTTP 响应

func Execute

func Execute(opts RequestOptions) (*Response, error)

Execute 执行 RESTful HTTP 请求

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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