mirror of https://github.com/shunfei/cronsun
parent
1196bed1a2
commit
413254b9d2
@ -1,4 +1,4 @@
|
||||
{
|
||||
BindAddr: ":7079",
|
||||
UIDir: ""
|
||||
"BindAddr": ":7079",
|
||||
"UIDir": ""
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cronsun
|
||||
|
||||
import (
|
||||
"sunteng/cronsun/conf"
|
||||
|
||||
"github.com/coreos/etcd/clientv3"
|
||||
)
|
||||
|
||||
var etcdClient *clientv3.Client
|
||||
|
||||
func EtcdInstance() (*clientv3.Client, error) {
|
||||
if etcdClient != nil {
|
||||
return etcdClient, nil
|
||||
}
|
||||
|
||||
if err := conf.Init(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
etcdClient, err := clientv3.New(conf.Config.Etcd)
|
||||
return etcdClient, err
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cronsun
|
||||
package models
|
||||
|
||||
type Job struct {
|
||||
Id string `json:"id"`
|
@ -1,4 +1,4 @@
|
||||
package cronsun
|
||||
package models
|
||||
|
||||
type Node struct {
|
||||
Pid int `json:"pid"`
|
Loading…
Reference in new issue