simplify call to peer

This commit is contained in:
mr 2024-08-23 09:55:30 +02:00
parent e8acf8a127
commit 9f72f4b2f8

View File

@ -3,8 +3,6 @@ package oclib
import (
"encoding/json"
"errors"
"fmt"
"time"
"cloud.o-forge.io/core/oc-lib/models/peer"
"cloud.o-forge.io/core/oc-lib/models/resources"
@ -63,30 +61,6 @@ func (wfa *Workflow) CheckBooking(caller *tools.HTTPCaller) (bool, error) {
return true, nil
}
func (wfa *Workflow) getFormat(date *time.Time) string {
month := fmt.Sprintf("%v", int(date.Month()))
day := fmt.Sprintf("%v", date.Day())
hour := fmt.Sprintf("%v", date.Hour())
minute := fmt.Sprintf("%v", date.Minute())
second := fmt.Sprintf("%v", date.Second())
if len(month) == 1 {
month = "0" + month
}
if len(day) == 1 {
day = "0" + day
}
if len(hour) == 1 {
hour = "0" + hour
}
if len(minute) == 1 {
minute = "0" + minute
}
if len(second) == 1 {
second = "0" + second
}
return fmt.Sprintf("%v", date.Year()) + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second
}
func (d *Workflow) GetName() string {
return d.Name
}