├── webui ├── webapp │ ├── static │ │ ├── .gitkeep │ │ ├── favicon.ico │ │ ├── favicon.ico_1 │ │ ├── favicon_2.ico │ │ ├── rockman5.png │ │ ├── rockman6.png │ │ ├── rockman7.png │ │ ├── rockman5@2x.png │ │ ├── rockman6@2x.png │ │ ├── rockman6@3x.png │ │ ├── rockman7@2x.png │ │ ├── rockman7@3x.png │ │ ├── rockman7.svg │ │ ├── rockman6.svg │ │ └── rockman5.svg │ ├── README.md │ ├── src │ │ ├── assets │ │ │ ├── styles │ │ │ │ ├── page.scss │ │ │ │ ├── main.scss │ │ │ │ ├── mixin.scss │ │ │ │ └── common.scss │ │ │ ├── script │ │ │ │ ├── common.js │ │ │ │ └── extend.js │ │ │ ├── logo.png │ │ │ ├── img │ │ │ │ └── bg.jpg │ │ │ ├── imgs │ │ │ │ ├── log.png │ │ │ │ ├── error.png │ │ │ │ ├── h5 │ │ │ │ │ ├── 01.jpg │ │ │ │ │ ├── 02.jpg │ │ │ │ │ ├── 03.jpg │ │ │ │ │ ├── 04.jpg │ │ │ │ │ ├── 05.jpg │ │ │ │ │ ├── 06.jpg │ │ │ │ │ └── 07.jpg │ │ │ │ ├── favicon.ico │ │ │ │ └── error-img.png │ │ │ ├── logo_1.png │ │ │ ├── logo_2.png │ │ │ ├── logo_3.png │ │ │ ├── rockman3.png │ │ │ ├── logo │ │ │ │ ├── rockman1.png │ │ │ │ ├── rockman3.png │ │ │ │ ├── rockman1@2x.png │ │ │ │ ├── rockman1@3x.png │ │ │ │ ├── rockman3@2x.png │ │ │ │ └── rockman3@3x.png │ │ │ ├── rockman1@2x.png │ │ │ ├── rockman1@3x.png │ │ │ ├── rockman3@2x.png │ │ │ ├── rockman3@3x.png │ │ │ ├── iconfont │ │ │ │ ├── iconfont.eot │ │ │ │ ├── iconfont.ttf │ │ │ │ ├── iconfont.woff │ │ │ │ ├── iconfont.woff2 │ │ │ │ └── iconfont.css │ │ │ └── css │ │ │ │ ├── common.less │ │ │ │ └── ViewContainer.less │ │ ├── views │ │ │ ├── home.vue │ │ │ ├── node │ │ │ │ ├── index.vue │ │ │ │ └── tableFormsViewGrid.js │ │ │ ├── login_1.vue │ │ │ ├── main │ │ │ │ ├── main.less │ │ │ │ └── index.vue │ │ │ └── task │ │ │ │ ├── components │ │ │ │ ├── stateLogs.vue │ │ │ │ ├── submitLogs.vue │ │ │ │ ├── glue.vue │ │ │ │ └── execLogs.vue │ │ │ │ └── logdetail.vue │ │ ├── api │ │ │ ├── cluster.js │ │ │ ├── login.js │ │ │ ├── api.js │ │ │ ├── logs.js │ │ │ ├── node.js │ │ │ ├── task.js │ │ │ └── mock.js │ │ ├── store │ │ │ ├── store.js │ │ │ └── modules │ │ │ │ ├── app.js │ │ │ │ └── user.js │ │ ├── app.vue │ │ ├── common │ │ │ ├── global.js │ │ │ ├── tableminix.js │ │ │ ├── http.js │ │ │ └── utils.js │ │ ├── router │ │ │ └── index.js │ │ └── main.js │ ├── .eslintignore │ ├── config │ │ ├── prod.env.js │ │ ├── dev.env.js │ │ └── index.js │ ├── .editorconfig │ ├── .gitignore │ ├── .postcssrc.js │ ├── index.html │ ├── .babelrc │ ├── build │ │ ├── vue-loader.conf.js │ │ ├── build.js │ │ ├── check-versions.js │ │ ├── webpack.base.conf.js │ │ ├── utils.js │ │ └── webpack.dev.conf.js │ ├── .eslintrc.js │ └── package.json ├── const │ └── const.go ├── validate │ └── validate.go ├── contract │ ├── QueryPageRequest.go │ └── Response.go ├── controllers │ ├── UserController.go │ ├── NodeController.go │ ├── Controller.go │ ├── ClusterController.go │ └── LogController.go └── server.go ├── runtime ├── runtime_test.go └── executor │ ├── test │ └── plugin │ │ └── hello.go │ ├── executor.go │ ├── goexec.go │ ├── httpexec.go │ └── shellexec.go ├── util ├── file │ ├── path_test.go │ ├── file.go │ ├── file_test.go │ └── path.go ├── netx │ └── netx.go ├── sysx │ ├── sysx_test.go │ └── sysx.go ├── exception │ └── exception.go ├── http │ ├── http_test.go │ └── http.go ├── json │ ├── json.go │ └── json_test.go └── uuid │ └── uuid_test.go ├── core ├── pageinfo.go ├── exception.go ├── const.go ├── cluster.go ├── executor.go ├── task.go ├── result.go ├── node.go └── resource.go ├── protected ├── model │ ├── LoginUser.go │ ├── PageInfo.go │ ├── LogInfo.go │ └── ExecutorInfo.go ├── service │ ├── BaseService.go │ └── LogService.go └── repository │ └── BaseRepository.go ├── tools ├── run.sh └── catool.sh ├── README.md ├── config ├── config_test.go └── config.go ├── docs └── list.md ├── rpc ├── handler │ ├── handler_test.go │ ├── handler.go │ └── handler_worker.go ├── packet │ └── reply.go ├── client │ └── client_master.go └── server.go ├── registry ├── consul │ ├── locker.go │ ├── consul_test.go │ └── consul.go └── registry.go ├── .gitignore ├── metrics ├── metrics_test.go ├── prometheus │ ├── metrics_test.go │ └── metrics.go ├── standard │ ├── counter.go │ └── counter_test.go └── metrics.go ├── node ├── node_flag.go └── node_worker.go ├── resources ├── config │ └── develop │ │ ├── app.conf │ │ └── dotlog.conf └── tls │ ├── client.crt │ ├── server.crt │ ├── client.key │ └── server.key ├── logger └── logger.go ├── scheduler └── scheduler.go └── main.go /webui/webapp/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webui/webapp/README.md: -------------------------------------------------------------------------------- 1 | # 任务管理系统 2 | -------------------------------------------------------------------------------- /runtime/runtime_test.go: -------------------------------------------------------------------------------- 1 | package runtime 2 | -------------------------------------------------------------------------------- /util/file/path_test.go: -------------------------------------------------------------------------------- 1 | package _file 2 | -------------------------------------------------------------------------------- /webui/webapp/src/assets/styles/page.scss: -------------------------------------------------------------------------------- 1 | /*各个页面私有css*/ 2 | -------------------------------------------------------------------------------- /webui/webapp/.eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /config/ 3 | /dist/ 4 | /*.js 5 | -------------------------------------------------------------------------------- /webui/webapp/src/views/home.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /webui/webapp/src/assets/script/common.js: -------------------------------------------------------------------------------- 1 | var test1 = function () { alert(11) } 2 | export { test1 } -------------------------------------------------------------------------------- /core/pageinfo.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type PageInfo struct { 4 | PageIndex int 5 | PageSize int 6 | } 7 | -------------------------------------------------------------------------------- /webui/webapp/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/favicon.ico -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo.png -------------------------------------------------------------------------------- /webui/webapp/static/favicon.ico_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/favicon.ico_1 -------------------------------------------------------------------------------- /webui/webapp/static/favicon_2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/favicon_2.ico -------------------------------------------------------------------------------- /webui/webapp/static/rockman5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman5.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman6.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman7.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/img/bg.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/log.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo_1.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo_2.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo_3.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/rockman3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/rockman3.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman5@2x.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman6@2x.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman6@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman6@3x.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman7@2x.png -------------------------------------------------------------------------------- /webui/webapp/static/rockman7@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/static/rockman7@3x.png -------------------------------------------------------------------------------- /protected/model/LoginUser.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type LoginUser struct { 4 | UserName string 5 | Token string 6 | } 7 | -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/error.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/01.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/02.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/03.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/04.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/05.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/06.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/06.jpg -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/h5/07.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/h5/07.jpg -------------------------------------------------------------------------------- /core/exception.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import "errors" 4 | 5 | var ErrorRpcClientCreate = errors.New("create rpc client error") 6 | -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/favicon.ico -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo/rockman1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo/rockman1.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo/rockman3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo/rockman3.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/rockman1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/rockman1@2x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/rockman1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/rockman1@3x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/rockman3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/rockman3@2x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/rockman3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/rockman3@3x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/imgs/error-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/imgs/error-img.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/iconfont/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/iconfont/iconfont.eot -------------------------------------------------------------------------------- /webui/webapp/src/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /webui/webapp/src/assets/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/iconfont/iconfont.woff -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo/rockman1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo/rockman1@2x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo/rockman1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo/rockman1@3x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo/rockman3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo/rockman3@2x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/logo/rockman3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/logo/rockman3@3x.png -------------------------------------------------------------------------------- /webui/webapp/src/assets/iconfont/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devfeel/rockman/HEAD/webui/webapp/src/assets/iconfont/iconfont.woff2 -------------------------------------------------------------------------------- /webui/webapp/src/assets/script/extend.js: -------------------------------------------------------------------------------- 1 | //对vue参数进行扩展 2 | var extend = function (param) { 3 | console.log(param) 4 | } 5 | export { extend } -------------------------------------------------------------------------------- /webui/webapp/src/assets/styles/main.scss: -------------------------------------------------------------------------------- 1 | @import "./base"; 2 | @import "./mixin"; 3 | @import "./common"; 4 | @import "./page"; 5 | @import "../theme/default/styls"; 6 | -------------------------------------------------------------------------------- /core/const.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | const ClusterKeyPrefix = "devfeel/rockman/" 4 | const DefaultTimeLayout = "2006-01-02 15:04:05" 5 | const DefaultLeaderCheckExecutorInterval = 60 6 | -------------------------------------------------------------------------------- /webui/webapp/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | let HOST = process.argv.splice(2)[0] || 'prod'; 3 | module.exports = { 4 | NODE_ENV: '"production"', 5 | HOST: '"' + HOST + '"' 6 | } 7 | -------------------------------------------------------------------------------- /webui/webapp/src/api/cluster.js: -------------------------------------------------------------------------------- 1 | import {get} from '../common/http.js' 2 | import GLOBAL from '../common/global.js' 3 | 4 | export const getClusterInfo = (data) => get(`${GLOBAL.HOME}/cluster/info`, data) 5 | -------------------------------------------------------------------------------- /tools/run.sh: -------------------------------------------------------------------------------- 1 | master1: nohup ./rockman -outerhost=116.62.16.66 -cluster=rock & 2 | master2: nohup ./rockman -outerhost=118.31.32.168 -cluster=rock & 3 | 4 | plugin: go build -buildmode=plugin -o plugin.so plugin.go -------------------------------------------------------------------------------- /webui/const/const.go: -------------------------------------------------------------------------------- 1 | package _const 2 | 3 | const ItemKeyNode = "rockman.node" 4 | 5 | const ( 6 | DefaultPageSize = 20 7 | ) 8 | 9 | const ( 10 | SuccessCode = 0 11 | ErrorCode = -9999 12 | ) 13 | -------------------------------------------------------------------------------- /webui/webapp/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /webui/webapp/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"', 7 | HOST: '"dev"' 8 | }) 9 | -------------------------------------------------------------------------------- /util/netx/netx.go: -------------------------------------------------------------------------------- 1 | package netx 2 | 3 | import "net" 4 | 5 | func CheckTcpConnect(endPoint string) bool { 6 | conn, err := net.Dial("tcp", endPoint) 7 | if err == nil { 8 | conn.Close() 9 | } 10 | return err == nil 11 | } 12 | -------------------------------------------------------------------------------- /webui/webapp/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /runtime/executor/test/plugin/hello.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | task "github.com/devfeel/dottask" 6 | ) 7 | 8 | func Exec(ctx *task.TaskContext) error { 9 | fmt.Println("print from plugin") 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rockman 2 | A distributed task scheduling platform. 3 | 4 | * Rockman是一个分布式调度解决方案,由两个相互独立的子项目dottask和Rockman组成 5 | * dottask: 定位为轻量级任务调度框架,使用go包的形式提供定时任务的调度服务 6 | * Rockman: 定位为分布式任务调度服务,是用完整集群提供资源治理、应用分发以及进程隔离等功能 7 | 8 | Public at 2020.04.15 16:15. 9 | -------------------------------------------------------------------------------- /config/config_test.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "fmt" 5 | "gopkg.in/yaml.v2" 6 | "testing" 7 | ) 8 | 9 | func TestGetDefaultProfileYaml(t *testing.T) { 10 | ob, _ := yaml.Marshal(DefaultProfile()) 11 | fmt.Println(fmt.Sprint(string(ob))) 12 | } 13 | -------------------------------------------------------------------------------- /webui/webapp/src/api/login.js: -------------------------------------------------------------------------------- 1 | import {get, post} from '../common/http.js' 2 | import GLOBAL from '../common/global.js' 3 | 4 | export const getUserInfo = (data) => post(`${GLOBAL.HOME}/getUserInfo`, data) 5 | export const login = (data) => get(`${GLOBAL.HOME}/user/login`, data) 6 | -------------------------------------------------------------------------------- /docs/list.md: -------------------------------------------------------------------------------- 1 | Leader\Worker协议: 2 | master: 3 | 1. ElectionLeader 4 | 2. SubmitExecutor 5 | 3. QueryWorkers 6 | 7 | worker: 8 | 1. GetLeaderInfo 9 | 2. RegisterWorker 10 | 3. RegisterExecutor 11 | 4. StartExecutor 12 | 5. StopExecutor 13 | 6. RemoveExecutor 14 | 7. QueryExecutors 15 | -------------------------------------------------------------------------------- /util/sysx/sysx_test.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestGetCpuTimeState(t *testing.T) { 9 | fmt.Println(GetCpuTimeState()) 10 | } 11 | 12 | func TestGetCpuUsedPercent(t *testing.T) { 13 | fmt.Println(GetCpuUsedPercent()) 14 | } 15 | -------------------------------------------------------------------------------- /core/cluster.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type ClusterInfo struct { 4 | ClusterId string 5 | RegistryServerUrl string 6 | LeaderKey string 7 | LeaderServer string 8 | NodeNum int 9 | WatchLeaderRetryLimit int 10 | QueryResourceInterval int 11 | } 12 | -------------------------------------------------------------------------------- /rpc/handler/handler_test.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "github.com/shirou/gopsutil/mem" 6 | "testing" 7 | ) 8 | 9 | func Test_GetMemory(t *testing.T) { 10 | v, _ := mem.VirtualMemory() 11 | fmt.Printf("UsedPercent:%f\n", v.UsedPercent) 12 | fmt.Println((int)(v.UsedPercent)) 13 | } 14 | -------------------------------------------------------------------------------- /webui/webapp/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /webui/webapp/src/assets/styles/mixin.scss: -------------------------------------------------------------------------------- 1 | @mixin hover{ 2 | cursor: pointer; 3 | opacity: 0.75; 4 | } 5 | @mixin flexCenter{ 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | } 10 | @mixin bgImg80($src){ 11 | background: url($src) center center /80% no-repeat; 12 | } 13 | -------------------------------------------------------------------------------- /registry/consul/locker.go: -------------------------------------------------------------------------------- 1 | package consul 2 | 3 | import "github.com/hashicorp/consul/api" 4 | 5 | type Locker struct { 6 | Locker *api.Lock 7 | } 8 | 9 | func (l *Locker) Lock() (<-chan struct{}, error) { 10 | return l.Locker.Lock(nil) 11 | } 12 | 13 | func (l *Locker) UnLock() error { 14 | return l.Locker.Unlock() 15 | } 16 | -------------------------------------------------------------------------------- /webui/webapp/src/store/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import user from './modules/user' 4 | // import app from './modules/app' 5 | 6 | Vue.use(Vuex); 7 | 8 | export default new Vuex.Store({ 9 | modules: { 10 | user 11 | }, 12 | getters: { 13 | token: state => state.user.token 14 | } 15 | }) 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | /.idea 17 | /bin 18 | -------------------------------------------------------------------------------- /protected/service/BaseService.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "github.com/devfeel/cache" 5 | "github.com/devfeel/dotlog" 6 | "github.com/devfeel/rockman/logger" 7 | ) 8 | 9 | type BaseService struct { 10 | RedisCache cache.RedisCache 11 | } 12 | 13 | func GetLogger() dotlog.Logger { 14 | return logger.GetLogger(logger.LoggerName_Service) 15 | } 16 | -------------------------------------------------------------------------------- /webui/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |{{.Task}}
62 |