dyer-cli is a handy tool for your easy and fast use of dyer, and recommanded to intergrate
rustandcargomust be installed,- OpenSSL library is required to compile openssl-sys(if not installed, see here)
the following code helps you get the tool:
cargo install dyer-cliOnce installed, run dyer in your terminal or cmd prompt, it prints some info like
Handy tool for dyerthen dyer-cli is successfully installed.
Dyer-cli generates a template that contains many useful instances and instructions when using dyer with following code:
dyer new myprojectIt will create a project called myproject and the files layout displays:
|___Cargo.toml
|___Readme.md
|___data/
|___data/tasks/
|___src/
|___src/affix.rs
|___src/entity.rs
|___src/parser.rs
|___src/actor.rs
|___src/middleware.rs
|___src/pipeline.rsMain functionality of each file:
- the
affix.rsserves as an actor to adjust and satisfy additional requirement - the
entity.rscontains entities/data structure to be used/collected - the
parser.rscontains functions that extract entities from response - the
actor.rscontains initial when opening and final things to do when closing - the
middleware.rscontains Some middlewares that process data at runtime - the
pipeline.rscontains entities manipulation including data-storage, displsying and so on - the
lib.rsexports all modules inside the directory, just do nothing here normally Cargo.tomlis the basic configuration of the projectREADME.mdcontains some instructions of the projectdata/place to store/load files ofAppwhen load-balancing and backup
Then it is your show time, basically there are simple example items(function, enum, struct)
in each file you can follow. After that check your code
dyer checkif you run it the first time, dyer-cli will download the crates and then check the code.
if some warning happens such as unused import or dead code the command does a lot for you:
dyer fixA wraper of cargo fix, if some warning happens such as unused import or dead code the command does a lot for you. However it won't help if some errors occur, if so, you have to debug the code manually.
Edit dyer.cfg file in the root directory
the file contains some configurations of ArgApp that will update periodically, for more details see
dyer.cfg Configuration
When the program compiles, haha run it:
dyer runShort as it seems, here represents the normal procedure to write your program. It is believed that learning by example is the best, and some examples are provided to illustrate how to use.
- Command Line Tool Support
- Interrupt and Resume Support
- Lock-free WorkFlow
- Xpath Response Selector (feature
xpath) - Proxy Support (feature
proxy) - Multiple Actors, MiddleWares, PipeLines
- More to go
It is, of course, probable that bugs and errors lie in somewhere, and defects may appear in an unexpected way, if you got any one, comments and suggestions are welcome, please new a issue in my github.