api_scan_baidu

command
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 8 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.

README

API 扫描示例(v3.0 Engine API)

本示例演示 (*Engine).GetBaseInfo 与 (*Engine).Scan 的组合使用 + sentinel error 处理。

运行

cd example/api_scan_baidu
go run main.go

核心点

// 1. 创建 Engine
engine, _ := sdk.NewEngine(ctx,
    sdk.WithFingerOptions(options),
    sdk.WithTimeout(5*time.Second),
)
defer engine.Close()

// 2. 仅基础信息(不跑指纹)
baseInfo, err := engine.GetBaseInfo(ctx, target)

// 3. 完整指纹识别
result, err := engine.Scan(ctx, target)

Sentinel Error 处理

result, err := engine.Scan(ctx, target)
switch {
case errors.Is(err, sdk.ErrEngineClosed):
    // 引擎已关闭
case errors.Is(err, sdk.ErrEmptyTarget):
    // 跳过空目标
case errors.Is(err, sdk.ErrEmptyResult):
    // 目标不可达 / 防火墙拦截
case err != nil:
    // 其他错误
}

Documentation

Overview

api_scan_baidu 演示 GetBaseInfo + Scan 的组合用法。

  • GetBaseInfo 仅获取目标基础信息(不跑指纹)
  • Scan 执行完整指纹识别
  • 使用 errors.Is + sentinel error 处理错误分支

Jump to

Keyboard shortcuts

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