modulepackage
0.0.0-20250101171817-22c3ed2fb008
Repository: https://github.com/wfunc/autotx.git
Documentation: pkg.go.dev
# README
AUTOTX
AUTOTX
is an automated task execution framework built with Go. It is designed to perform tasks like logging into web pages, fetching data, and executing browser interactions using chromedp
. The project is modular and extensible, allowing you to define and manage tasks efficiently.
đ Available in other languages:
đ¨đŗ įŽäŊ䏿
Directory Structure
AUTOTX
âââ build/server/ # Compiled executables
â âââ autotx
âââ runner/ # Task runner module
â âââ runner_test.go # Unit tests for runner
â âââ runner.go # Runner implementation
âââ task/ # Task definitions and logic
â âââ base.go # BaseTask for shared functionality
â âââ example.go # Example task implementation
â âââ items.go # Additional task logic
â âââ login.go # Login task logic
â âââ sign_in.go # Sign-in task logic
â âââ task.go # Task interface and utilities
âââ .gitignore # Git ignore file
âââ autotx # Build output
âââ build-go.sh # Go build script
âââ DockerfileGo # Docker build configuration
âââ go.mod # Go module configuration
âââ go.sum # Go module dependencies
âââ README_CN.md # Chinese documentation
âââ README.md # English documentation (default)
âââ run.sh # Script to run the project
âââ service.go # Service entry point
Features
- Modular Design:
- Centralized
BaseTask
for shared task properties and methods. - Extensible task definitions (e.g.,
LoginTask
,ExampleTask
).
- Centralized
- Browser Automation:
- Uses
chromedp
for headless Chrome interactions.
- Uses
- Task Runner:
- Manages task execution lifecycle (start, stop, loop).
Usage
1. Clone the Repository
git clone https://github.com/your-repo/autotx.git
cd autotx
2. Install Dependencies
Ensure you have Go 1.18+ installed.
go mod tidy
3. Run the Project
Locally
go run service.go
Using the Run Script
./run.sh
Using Docker Build
docker build -t autotx -f DockerfileGo .
Using Docker run
docker run -it \
-e HEADLESS=1 \
-e Verbose=1 \
-e CodeURL=https://example.com \
autotx
Testing
Run unit tests:
go test ./runner/ ./task/
Adding New Tasks
- Create a new file in the
task/
directory, e.g.,my_task.go
, and implement theTask
interface. - Use the
BaseTask
to inherit shared logic. - Register the new task in your runner or service logic.
Contributing
Contributions are welcome! Please submit a pull request with your changes.