# ggtsync **Repository Path**: banggua/ggtsync ## Basic Information - **Project Name**: ggtsync - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-03-06 - **Last Updated**: 2022-06-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ggtsync 同步工具 ## 使用指南 命令 ```shell $ ggtsync -h An extensible synchronization tool Usage: ggtsync [flags] Flags: -c, --config string config file (default "ggtsync.yaml") -h, --help help for ggtsync -s, --signal string send signal to a master process: start, quit, reload (default "start") -t, --test test configuration and exit -v, --version show version and exit -z, --zap use zap logger ``` 配置 ```yaml projects: - name: fuchsia order: 1 type: jiri from: integration flower https://fuchsia.googlesource.com/integration to: /vdb/git interval: 24 args: baseurl: https://fuchsia.fsf.org.cn/git cipddir: /vdb/cipd manifest: fuchsia-integration manifestdir: /vdb/manifest useremail: banggua@qq.com username: banggua plugins: - name: chmod order: 2 args: path: /vdb/git - name: rsync order: 3 args: path: /vdb/git remote: root@fsf.org.cn:/vdb - name: rsync order: 4 args: path: /vdb/cipd remote: root@fsf.org.cn:/vdb - name: rsync order: 5 args: path: /vdb/manifest remote: root@fsf.org.cn:/vdb ``` ## 扩展指南 Handler `handler/handler.go` ```go type Handler interface { Test(*config.Project) error Templet() string Handle(*config.Project) error Close(*config.Project) error } ``` ```go func init() { defaultHandlerManager.handlers[jiri.HandlerName] = jiri.DefaultJiriClient } ``` Plugin `plugin/plugin.go` ```go type Plugin interface { Test(map[string]string) error Templet() string Handle(*config.Project, map[string]string) error } ``` ```go func init() { defaultPluginManager.plugins[chmod.PluginName] = chmod.DefaultPlugin defaultPluginManager.plugins[rsync.PluginName] = rsync.DefaultPlugin } ``` Logger `logger/logger.go` ```go type Logger interface { Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) } ```