add config

This commit is contained in:
Andrey Belvedersky
2021-06-06 03:46:11 +03:00
parent 0aa4922105
commit f3175b8ce9
10 changed files with 97 additions and 433 deletions

13
pkg/utils/exit.go Normal file
View File

@ -0,0 +1,13 @@
package utils
import (
"log"
"os"
"time"
)
func Exit(err error) {
log.Println(err)
time.Sleep(time.Second * 2)
os.Exit(1)
}

View File

@ -11,14 +11,14 @@ import (
)
func Hack() {
cfg, _ := settings.GetConfig()
cfg, _ := settings.GetConfig("settings")
tp := jira.BasicAuthTransport{
Username: cfg.Jira.Auth.Username,
Password: cfg.Jira.Auth.Password,
}
jiraClient, _ := jira.NewClient(tp.Client(), cfg.Jira.Url)
me, _, _ := jiraClient.User.GetSelf()
timeNeed := 165 // Количество часов

View File

@ -15,3 +15,5 @@ func GetProducer() *nsq.Producer {
}
return producer
}
func GetConsumer()

16
pkg/utils/wait.go Normal file
View File

@ -0,0 +1,16 @@
package utils
import (
"os"
"os/signal"
"syscall"
)
func Wait() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
select {
case <-c:
return
}
}