catalog

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 4 Imported by: 1 module, 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

Overview

Package catalog 保存官方 DNS / 部署插件共用的静态元数据。

数据从主仓库的 ProviderDef 导出,保证服务商 ID、字段 key、lego 环境变量 与历史版本逐项一致。主仓库通过 import 本包获得同一份数据,避免两处维护。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeprecatedDeployTypes

func DeprecatedDeployTypes() map[string]string

DeprecatedDeployTypes 返回已合并的旧部署目标 ID 到规范 ID 的映射。

func EnvForProvider

func EnvForProvider(def Provider, cfg map[string]string) map[string]string

EnvForProvider 把 DNS 服务商表单字段转换为 lego 环境变量。

Types

type Condition

type Condition struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Condition 描述字段显示条件。

type Field

type Field struct {
	Key            string `json:"key"`
	Label          string `json:"label,omitempty"`
	LabelKey       string `json:"label_key,omitempty"`
	Type           string `json:"type,omitempty"`
	Required       bool   `json:"required,omitempty"`
	Secret         bool   `json:"secret,omitempty"`
	Placeholder    string `json:"placeholder,omitempty"`
	PlaceholderKey string `json:"placeholder_key,omitempty"`
	Help           string `json:"help,omitempty"`
	HelpKey        string `json:"help_key,omitempty"`
	Default        string `json:"default,omitempty"`
	// Env 是字段对应的 lego 环境变量名,仅 DNS 服务商使用。
	Env     string     `json:"env,omitempty"`
	Options []Option   `json:"options,omitempty"`
	ShowIf  *Condition `json:"show_if,omitempty"`
}

Field 描述服务商或部署目标的配置字段。

func (Field) LocalizedHelp

func (f Field) LocalizedHelp(locale i18n.Locale) string

LocalizedHelp 返回字段帮助文本。

func (Field) LocalizedLabel

func (f Field) LocalizedLabel(locale i18n.Locale) string

LocalizedLabel 返回字段标签。

func (Field) LocalizedPlaceholder

func (f Field) LocalizedPlaceholder(locale i18n.Locale) string

LocalizedPlaceholder 返回字段占位提示。

type Option

type Option struct {
	Label    string `json:"label,omitempty"`
	LabelKey string `json:"label_key,omitempty"`
	Value    string `json:"value"`
}

Option 是下拉选项。

func (Option) LocalizedLabel

func (o Option) LocalizedLabel(locale i18n.Locale) string

LocalizedOption 返回下拉选项的展示文本。

type Provider

type Provider struct {
	Value        string  `json:"value"`
	Label        string  `json:"label,omitempty"`
	LabelKey     string  `json:"label_key,omitempty"`
	Desc         string  `json:"desc,omitempty"`
	DescKey      string  `json:"desc_key,omitempty"`
	Deprecated   bool    `json:"deprecated,omitempty"`
	Fields       []Field `json:"fields,omitempty"`
	DeployFields []Field `json:"deploy_fields,omitempty"`
}

Provider 描述一个 DNS 服务商或部署目标。

func DNSProviders

func DNSProviders() []Provider

DNSProviders 返回全部官方 DNS 服务商元数据,顺序与历史版本一致。

func Deployers

func Deployers() []Provider

Deployers 返回全部官方部署目标元数据,顺序与历史版本一致。

func LookupDNS

func LookupDNS(id string) (Provider, bool)

LookupDNS 按 ID 查找 DNS 服务商元数据。

func LookupDeployer

func LookupDeployer(id string) (Provider, bool)

LookupDeployer 按 ID 查找部署目标元数据。

func (Provider) LocalizedDesc

func (p Provider) LocalizedDesc(locale i18n.Locale) string

LocalizedDesc 返回服务商或部署目标的说明。

func (Provider) LocalizedName

func (p Provider) LocalizedName(locale i18n.Locale) string

LocalizedName 返回服务商或部署目标的展示名称。

Jump to

Keyboard shortcuts

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