Add Caps method to get UUID value
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Fri, 13 Oct 2017 17:20:07 +0000 (19:20 +0200)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Mon, 5 Mar 2018 17:29:31 +0000 (18:29 +0100)
Change-Id: I3c5ee9a4a3a399648328be6f2e03fab7eb7d56b0
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
Reviewed-on: https://mcdsrvbld02.digital.local/review/49608
Reviewed-by: Maciej Wereski <m.wereski@partner.samsung.com>
Tested-by: Maciej Wereski <m.wereski@partner.samsung.com>
boruta.go

index adae8e0..a80e1ed 100644 (file)
--- a/boruta.go
+++ b/boruta.go
@@ -64,6 +64,13 @@ const (
 // They are also known as caps.
 type Capabilities map[string]string
 
+// GetWorkerUUID returns WorkerUUID stored in caps.
+//
+// It assumes that "UUID" key is present and should be used only when this fact was verified.
+func (caps Capabilities) GetWorkerUUID() WorkerUUID {
+       return WorkerUUID(caps["UUID"])
+}
+
 // ReqID refers to the Request created by the User.
 type ReqID uint64