conntest

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package conntest 维护资产「表单连接测试」的 runtime 分发注册表。

各连接测试是 binder 的实例方法(持有 live manager/pool),无法在 init() 注册; 故 binder 在 New() 时把去掉信封的 tester 注册进来,由 system binder 的 TestAssetConnection 统一查表分发(共享 i18n ctx + 超时 + testreg 取消信封)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(assetType string, fn TestFunc)

Register 登记某资产类型的 tester(同类型重复登记以最后一次为准)。

func Unregister

func Unregister(assetType string)

Unregister 移除某资产类型的 tester(主要供测试清理)。

Types

type TestFunc

type TestFunc func(ctx context.Context, configJSON, plainPassword string) error

TestFunc 用给定 ctx(已含超时/取消)测试一份未保存的资产配置。 configJSON 是前端配置的 JSON;plainPassword 为空时由 tester 自行兜底解析。

func Lookup

func Lookup(assetType string) (TestFunc, bool)

Lookup 取某资产类型的 tester;未注册返回 ok=false。

Jump to

Keyboard shortcuts

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