as
This commit is contained in:
parent
037cdbbcaf
commit
d8d1fc3679
2 changed files with 13 additions and 11 deletions
|
|
@ -44,13 +44,15 @@ func Auth() {
|
|||
}
|
||||
|
||||
log.Println("Run")
|
||||
res, err := http.Post(Url, "application/json", login)
|
||||
LoginOut, err := http.Post(Url, "application/json", login)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Error during authentication: %v", err)
|
||||
return
|
||||
}
|
||||
log.Println(res)
|
||||
log.Println("")
|
||||
defer LoginOut.Body.Close()
|
||||
out := LoginOut.Header.Values("Set-Cookie")
|
||||
|
||||
log.Println(out)
|
||||
|
||||
}
|
||||
|
|
|
|||
16
main.go
16
main.go
|
|
@ -9,8 +9,8 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
|
||||
// "os/signal"
|
||||
// "syscall"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
Untis "untislogger/Bot"
|
||||
|
||||
|
|
@ -45,14 +45,14 @@ func init() {
|
|||
func main() {
|
||||
go Untis.Auth() //starting API calls function
|
||||
// Create a channel to receive OS signals
|
||||
/* sigChan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
||||
sigChan := make(chan os.Signal, 1)
|
||||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
log.Println("Program is running. Press Ctrl+C to stop.")
|
||||
log.Println("Program is running. Press Ctrl+C to stop.")
|
||||
|
||||
// Block until we receive a signal
|
||||
<-sigChan
|
||||
log.Println("Shutting down...") */
|
||||
// Block until we receive a signal
|
||||
<-sigChan
|
||||
log.Println("Shutting down...")
|
||||
}
|
||||
|
||||
func testPubIP() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue