Commit bf7a665c authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Change string method

parent 7531772d
......@@ -46,7 +46,10 @@ type (
)
func (dep Dep) String() string {
return fmt.Sprintf("[Dep:%v:%v]", dep.ID, dep.Service.Name)
if dep.Service != (config.Service{}) {
return fmt.Sprintf("Dep[%v]#%v", dep.Service.Name, dep.ID)
}
return fmt.Sprintf("Dep#%v", dep.ID)
}
// Log logs a message for a Dep
......@@ -55,7 +58,7 @@ func (dep Dep) Log(formatString string, params ...interface{}) {
}
func (rep Reply) String() string {
return fmt.Sprintf("[Dep:%v:%v]", rep.ID, rep.Service.Name)
return fmt.Sprintf("Rep[%v]#%v]", rep.Service.Name, rep.ID)
}
// Log logs a message for a Reply
......
package deps
import (
"fmt"
"log"
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalScripts"
)
type (
// VO virtual organisation
VO struct {
ID int `json:"id"`
Name string `json:"name"`
ResourceType string `json:"resourcetype"`
}
// Dep describes a deployment action
Dep struct {
ID int `json:"id"`
StateTarget scripts.State `json:"state_target"`
User scripts.User `json:"user"`
Credentials map[string][]scripts.Credential `json:"credentials"`
Questionnaire map[string]string `json:"questionnaire"`
// this relates to the polymorphic type added by the polymorphic serializer
ResourceType string `json:"resourcetype"`
// VO is only set if this is a VODeployment
VO VO `json:"vo,omitempty"`
// Service may be filled by scheduleDep
Service config.Service `json:"service,omitempty"`
}
// Reply is sent back to the backend to inform it about executed deployment actions
Reply struct {
// ID of the according Dep (at the backend: DeploymentState)
ID int `json:"id"`
Output scripts.Output `json:"output"`
// Service is the service for which we performed the deploy action
Service config.Service `json:"service"`
}
)
func (dep Dep) String() string {
return fmt.Sprintf("[Dep:%v:%v]", dep.ID, dep.Service.Name)
}
// Log logs a message for a Dep
func (dep Dep) Log(formatString string, params ...interface{}) {
log.Printf("%s "+formatString, append([]interface{}{dep}, params...)...)
}
func (rep Reply) String() string {
return fmt.Sprintf("[Dep:%v:%v]", rep.ID, rep.Service.Name)
}
// Log logs a message for a Reply
func (rep Reply) Log(formatString string, params ...interface{}) {
log.Printf("%s "+formatString, append([]interface{}{rep}, params...)...)
}
......@@ -7,7 +7,7 @@ import (
"os"
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalClient/deps"
"git.scc.kit.edu/feudal/feudalClient/deployments"
"git.scc.kit.edu/feudal/feudalClient/sink"
"git.scc.kit.edu/feudal/feudalClient/sink/script"
"git.scc.kit.edu/feudal/feudalClient/source"
......@@ -22,6 +22,8 @@ var (
"Client for the Federated User Credential Deployment Portal (FEUDAL)",
).Author(
"Lukas Burgey",
).Version(
"v1.1.0",
)
cmdStart = app.Command("start", "Starts the client in its normal operation mode.").Default()
cmdDeregister = app.Command("deregister", "Before disabling the client: Use deregister to inform the backend that the client ceases operation.")
......
......@@ -13,7 +13,7 @@ import (
"time"
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalClient/deps"
"git.scc.kit.edu/feudal/feudalClient/deployments"
"git.scc.kit.edu/feudal/feudalScripts"
)
......
......@@ -2,7 +2,7 @@ package sink
import (
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalClient/deps"
"git.scc.kit.edu/feudal/feudalClient/deployments"
)
// Sink handles incoming deployments
......
......@@ -8,7 +8,7 @@ import (
"time"
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalClient/deps"
"git.scc.kit.edu/feudal/feudalClient/deployments"
"github.com/streadway/amqp"
)
......
......@@ -10,7 +10,7 @@ import (
"time"
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalClient/deps"
"git.scc.kit.edu/feudal/feudalClient/deployments"
)
type (
......
......@@ -2,7 +2,7 @@ package source
import (
"git.scc.kit.edu/feudal/feudalClient/config"
"git.scc.kit.edu/feudal/feudalClient/deps"
"git.scc.kit.edu/feudal/feudalClient/deployments"
)
// Source are sources of deployments like amqp and http
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment