Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASweb-backend-go
Commits
33eab641
Commit
33eab641
authored
Oct 14, 2020
by
Sonja Happ
Browse files
AMQP: add WS and API URL in IC updates
parent
b93598bf
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
amqp/amqpclient.go
View file @
33eab641
...
...
@@ -59,6 +59,8 @@ type ICUpdate struct {
Category
*
string
`json:"category"`
Type
*
string
`json:"type"`
Location
*
string
`json:"location"`
WS_url
*
string
`json:"ws_url"`
API_url
*
string
`json:"api_url"`
}
`json:"properties"`
}
...
...
@@ -269,6 +271,12 @@ func processMessage(message amqp.Delivery) {
}
else
{
newICReq
.
InfrastructureComponent
.
State
=
"unknown"
}
if
payload
.
Properties
.
WS_url
!=
nil
{
newICReq
.
InfrastructureComponent
.
Host
=
*
payload
.
Properties
.
WS_url
}
if
payload
.
Properties
.
API_url
!=
nil
{
newICReq
.
InfrastructureComponent
.
APIHost
=
*
payload
.
Properties
.
API_url
}
if
payload
.
Properties
.
Location
!=
nil
{
newICReq
.
InfrastructureComponent
.
Properties
=
postgres
.
Jsonb
{
json
.
RawMessage
(
`{"location" : " `
+
*
payload
.
Properties
.
Location
+
`"}`
)}
}
...
...
@@ -310,6 +318,12 @@ func processMessage(message amqp.Delivery) {
if
payload
.
Properties
.
Name
!=
nil
{
updatedICReq
.
InfrastructureComponent
.
Name
=
*
payload
.
Properties
.
Name
}
if
payload
.
Properties
.
WS_url
!=
nil
{
updatedICReq
.
InfrastructureComponent
.
Host
=
*
payload
.
Properties
.
WS_url
}
if
payload
.
Properties
.
API_url
!=
nil
{
updatedICReq
.
InfrastructureComponent
.
APIHost
=
*
payload
.
Properties
.
API_url
}
if
payload
.
Properties
.
Location
!=
nil
{
updatedICReq
.
InfrastructureComponent
.
Properties
=
postgres
.
Jsonb
{
json
.
RawMessage
(
`{"location" : " `
+
*
payload
.
Properties
.
Location
+
`"}`
)}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment