Skip to content

Conversation

Copy link

Copilot AI commented Nov 17, 2025

Restructures the project to match the plugin-based architecture, configuration system, and interface design of Loyalsoldier/geoip.

Architecture Changes

  • Plugin system: Core interfaces (InputConverter, OutputConverter) in lib/, implementations in plugin/plaintext/ and plugin/v2ray/
  • Config-driven: JSON configuration replaces CLI flags, supports local/remote files
  • CLI with cobra: convert and list commands replace single entrypoint
  • Go 1.23: Upgraded for iter.Seq iterators

Structure

lib/
├── lib.go          # Core interfaces
├── config.go       # JSON config parsing
├── container.go    # Thread-safe domain container
├── entry.go        # Domain list entries
└── instance.go     # Conversion pipeline

plugin/
├── plaintext/      # Domain list I/O, text output
└── v2ray/          # geosite.dat, GFWList output

Migration

Before:

go run ./ --datapath=./data --excludeattrs="cn@!cn@ads" --exportlists="cn,google"

After:

./domain-list-custom convert -c config.json
{
  "input": [
    {"type": "domainlist", "action": "add", "args": {"dataDir": "./data"}}
  ],
  "output": [
    {
      "type": "v2rayGeoSite",
      "action": "output",
      "args": {
        "outputDir": "./output",
        "excludeAttrs": "cn@!cn@ads"
      }
    },
    {
      "type": "text",
      "action": "output",
      "args": {"wantedList": ["cn", "google"]}
    }
  ]
}

Output formats unchanged. GitHub Actions workflow updated to use new config-based build.

Original prompt

Rework this project by referencing the directory structure, interface design, and configuration methods of project https://github.com/Loyalsoldier/geoip


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Rework project structure and configuration methods Rework project structure following geoip architecture Nov 17, 2025
Copilot AI requested a review from Loyalsoldier November 17, 2025 18:30
Copilot finished work on behalf of Loyalsoldier November 17, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants