mirror of
https://github.com/tuna/tunasync.git
synced 2025-04-21 12:52:45 +00:00
67 lines
2.5 KiB
Markdown
67 lines
2.5 KiB
Markdown
tunasync
|
|
========
|
|
|
|
[](https://travis-ci.org/tuna/tunasync)
|
|
[](https://coveralls.io/github/tuna/tunasync?branch=dev)
|
|
[](http://commitizen.github.io/cz-cli/)
|
|

|
|
|
|
## Get Started
|
|
|
|
- [中文文档](https://github.com/tuna/tunasync/blob/master/docs/zh_CN/get_started.md)
|
|
|
|
## Download
|
|
|
|
Pre-built binary for Linux x86_64 is available at [Github releases](https://github.com/tuna/tunasync/releases/latest).
|
|
|
|
## Design
|
|
|
|
```
|
|
# Architecture
|
|
|
|
- Manager: Central instance for status and job management
|
|
- Worker: Runs mirror jobs
|
|
|
|
+------------+ +---+ +---+
|
|
| Client API | | | Job Status | | +----------+ +----------+
|
|
+------------+ | +----------------->| |--->| mirror +---->| mirror |
|
|
+------------+ | | | w | | config | | provider |
|
|
| Worker API | | H | | o | +----------+ +----+-----+
|
|
+------------+ | T | Job Control | r | |
|
|
+------------+ | T +----------------->| k | +------------+ |
|
|
| Job/Status | | P | Start/Stop/... | e | | mirror job |<----+
|
|
| Management | | S | | r | +------^-----+
|
|
+------------+ | | Update Status | | +---------+---------+
|
|
+------------+ | <------------------+ | | Scheduler |
|
|
| BoltDB | | | | | +-------------------+
|
|
+------------+ +---+ +---+
|
|
|
|
|
|
# Job Run Process
|
|
|
|
|
|
PreSyncing Syncing Success
|
|
+-----------+ +-----------+ +-------------+ +--------------+
|
|
| pre-job +--+->| job run +--->| post-exec +-+-->| post-success |
|
|
+-----------+ ^ +-----------+ +-------------+ | +--------------+
|
|
| |
|
|
| +-----------------+ | Failed
|
|
+------+ post-fail |<---------+
|
|
+-----------------+
|
|
```
|
|
|
|
|
|
## Building
|
|
|
|
Setup GOPATH like [this](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable).
|
|
|
|
Then:
|
|
|
|
```
|
|
go get -d github.com/tuna/tunasync/cmd/tunasync
|
|
cd $GOPATH/src/github.com/tuna/tunasync
|
|
make
|
|
```
|
|
|
|
If you have multiple `GOPATH`s, replace the `$GOPATH` with your first one.
|