# gyyyy/zoomeye-go architecture

> Architecture diagram of the GitHub repository gyyyy/zoomeye-go, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gyyyy/zoomeye-go
- Repository: https://github.com/gyyyy/zoomeye-go

## Overview

ZoomEye-go is both a Go SDK and a CLI for authenticating to ZoomEye and searching host/web assets, inspecting account resources and device history, and analyzing or exporting results. The main CLI workflow runs through command handlers and ZoomEyeAgent, which manages credentials, caching, local data, and API calls; result analysis and presentation follow. The README also documents local-file loading and multi-page SDK searches. Some command and agent implementations were sampled only in excerpts, so links for documented capabilities are shown only where their entry points are supported.

Main entry points: [`agent.go`](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go) (Agent workflow), [`cmd.go`](https://github.com/gyyyy/zoomeye-go/blob/master/cmd.go) (Command handlers), [`zoomeye/zoomeye.go`](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go) (HTTP requests), [`zoomeye/result.go`](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/result.go) (Filter and statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_entry["Command dispatch<br/>[main.go]"]
  node_commands["Command handlers<br/>[cmd.go]"]
end

subgraph group_agent["Agent and local data"]
  node_agent["Agent workflow<br/>[agent.go]"]
  node_config["Configuration<br/>[agent.go]"]
  node_files["File operations<br/>[file.go]"]
  node_credential_store[("Credentials<br/>[agent.go]")]
  node_search_cache[("Search cache<br/>[agent.go]")]
  node_local_data[("Local data files<br/>[agent.go]")]
  node_load["Load local results<br/>[agent.go]"]
end

subgraph group_sdk["ZoomEye SDK"]
  node_sdk["SDK client<br/>[zoomeye.go]"]
  node_http["HTTP requests<br/>[zoomeye.go]"]
  node_auth["Login and resources<br/>[zoomeye.go]"]
  node_search["Host/web search<br/>[zoomeye.go]"]
  node_pagination["Multi-page search<br/>[zoomeye.go]"]
  node_history["IP history<br/>[zoomeye.go]"]
end

subgraph group_results["Results and presentation"]
  node_result_types["Result models<br/>[result.go]"]
  node_analysis["Filter and statistics<br/>[result.go]"]
  node_presentation["Display and charts<br/>[print.go]"]
end

node_user(("CLI user"))
node_api{{"ZoomEye API"}}

node_user -->|"runs command"| node_entry
node_entry -->|"dispatches"| node_commands
node_commands -->|"invokes workflow"| node_agent
node_agent -->|"loads settings"| node_config
node_config -->|"reads config"| node_files
node_agent -->|"reads/writes"| node_credential_store
node_agent -->|"reads/writes"| node_search_cache
node_agent -->|"loads/saves"| node_local_data
node_agent -->|"uses file helpers"| node_files
node_agent -->|"calls API client"| node_sdk
node_sdk -->|"performs auth/info"| node_auth
node_sdk -->|"runs search"| node_search
node_sdk -->|"runs pages"| node_pagination
node_pagination -->|"requests pages"| node_search
node_sdk -->|"queries IP history"| node_history
node_auth -->|"sends requests"| node_http
node_search -->|"sends requests"| node_http
node_history -->|"sends requests"| node_http
node_http -->|"sends API calls"| node_api
node_api -->|"returns responses"| node_http
node_http -->|"decodes responses"| node_result_types
node_commands -->|"loads file data"| node_load
node_load -->|"reads JSON"| node_files
node_commands -->|"analyzes results"| node_analysis
node_commands -->|"renders output"| node_presentation
node_analysis -->|"provides summaries"| node_presentation
node_result_types -->|"supports operations"| node_analysis
node_commands -->|"saves exports"| node_local_data

click node_entry "https://github.com/gyyyy/zoomeye-go/blob/master/main.go"
click node_commands "https://github.com/gyyyy/zoomeye-go/blob/master/cmd.go"
click node_agent "https://github.com/gyyyy/zoomeye-go/blob/master/agent.go"
click node_config "https://github.com/gyyyy/zoomeye-go/blob/master/agent.go"
click node_files "https://github.com/gyyyy/zoomeye-go/blob/master/file.go"
click node_credential_store "https://github.com/gyyyy/zoomeye-go/blob/master/agent.go"
click node_search_cache "https://github.com/gyyyy/zoomeye-go/blob/master/agent.go"
click node_local_data "https://github.com/gyyyy/zoomeye-go/blob/master/agent.go"
click node_sdk "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go"
click node_http "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go"
click node_auth "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go"
click node_search "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go"
click node_pagination "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go"
click node_history "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go"
click node_result_types "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/result.go"
click node_analysis "https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/result.go"
click node_load "https://github.com/gyyyy/zoomeye-go/blob/master/agent.go"
click node_presentation "https://github.com/gyyyy/zoomeye-go/blob/master/print.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_commands,node_user toneBlue
class node_agent,node_config,node_files,node_credential_store,node_search_cache,node_local_data,node_load toneAmber
class node_sdk,node_http,node_auth,node_search,node_pagination,node_history,node_api toneMint
class node_result_types,node_analysis,node_presentation toneRose
```

## Components

### CLI

- [Command dispatch](https://github.com/gyyyy/zoomeye-go/blob/master/main.go): `main.go`
- [Command handlers](https://github.com/gyyyy/zoomeye-go/blob/master/cmd.go): `cmd.go`

### Agent and local data

- [Agent workflow](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go): `agent.go`
- [Configuration](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go): `agent.go`
- [File operations](https://github.com/gyyyy/zoomeye-go/blob/master/file.go): `file.go`
- [Credentials](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go): `agent.go`
- [Search cache](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go): `agent.go`
- [Local data files](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go): `agent.go`
- [Load local results](https://github.com/gyyyy/zoomeye-go/blob/master/agent.go): `agent.go`

### ZoomEye SDK

- [SDK client](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go): `zoomeye/zoomeye.go`
- [HTTP requests](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go): `zoomeye/zoomeye.go`
- [Login and resources](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go): `zoomeye/zoomeye.go`
- [Host/web search](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go): `zoomeye/zoomeye.go`
- [Multi-page search](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go): `zoomeye/zoomeye.go`
- [IP history](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/zoomeye.go): `zoomeye/zoomeye.go`

### Results and presentation

- [Result models](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/result.go): `zoomeye/result.go`
- [Filter and statistics](https://github.com/gyyyy/zoomeye-go/blob/master/zoomeye/result.go): `zoomeye/result.go`
- [Display and charts](https://github.com/gyyyy/zoomeye-go/blob/master/print.go): `print.go`

### Other components

- **CLI user**
- **ZoomEye API**

## Connections

- CLI user → Command dispatch: runs command
- Command dispatch → Command handlers: dispatches
- Command handlers → Agent workflow: invokes workflow
- Agent workflow → Configuration: loads settings
- Configuration → File operations: reads config
- Agent workflow → Credentials: reads/writes
- Agent workflow → Search cache: reads/writes
- Agent workflow → Local data files: loads/saves
- Agent workflow → File operations: uses file helpers
- Agent workflow → SDK client: calls API client
- SDK client → Login and resources: performs auth/info
- SDK client → Host/web search: runs search
- SDK client → Multi-page search: runs pages
- Multi-page search → Host/web search: requests pages
- SDK client → IP history: queries IP history
- Login and resources → HTTP requests: sends requests
- Host/web search → HTTP requests: sends requests
- IP history → HTTP requests: sends requests
- HTTP requests → ZoomEye API: sends API calls
- ZoomEye API → HTTP requests: returns responses
- HTTP requests → Result models: decodes responses
- Command handlers → Load local results: loads file data
- Load local results → File operations: reads JSON
- Command handlers → Filter and statistics: analyzes results
- Command handlers → Display and charts: renders output
- Filter and statistics → Display and charts: provides summaries
- Result models → Filter and statistics: supports operations
- Command handlers → Local data files: saves exports
