-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add service to query cluster Signed-off-by: Artur Troian <[email protected]>
- Loading branch information
Showing
22 changed files
with
657 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package v1 | ||
|
||
func (cl *Cluster) Dup() *Cluster { | ||
res := &Cluster{ | ||
Nodes: nil, | ||
Storage: nil, | ||
} | ||
|
||
return res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package v1 | ||
|
||
func (r *CPU) Dup() CPU { | ||
res := CPU{ | ||
Quantity: r.Quantity.Dup(), | ||
Info: r.Info.Dup(), | ||
} | ||
|
||
return res | ||
} | ||
|
||
func (s CPUInfoS) Dup() CPUInfoS { | ||
if len(s) == 0 { | ||
return nil | ||
} | ||
|
||
res := make(CPUInfoS, 0, len(s)) | ||
|
||
for _, n := range s { | ||
res = append(res, CPUInfo{ | ||
ID: n.ID, | ||
Vendor: n.Vendor, | ||
Model: n.Model, | ||
Vcores: n.Vcores, | ||
}) | ||
} | ||
|
||
return res | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package v1 | ||
|
||
func (s GPUs) Dup() GPUs { | ||
if len(s) == 0 { | ||
return nil | ||
} | ||
|
||
res := make(GPUs, 0, len(s)) | ||
|
||
for _, g := range s { | ||
res = append(res, g.Dup()) | ||
} | ||
|
||
return res | ||
} | ||
|
||
func (r *GPU) Dup() GPU { | ||
res := GPU{ | ||
Quantity: r.Quantity.Dup(), | ||
Info: r.Info.Dup(), | ||
} | ||
|
||
return res | ||
} | ||
|
||
func (s *GPUInfo) Dup() GPUInfo { | ||
res := GPUInfo{ | ||
Vendor: s.Vendor, | ||
Name: s.Name, | ||
ModelID: s.ModelID, | ||
Interface: s.Interface, | ||
MemorySize: s.MemorySize, | ||
} | ||
|
||
return res | ||
} | ||
|
||
func (s GPUInfoS) Dup() GPUInfoS { | ||
if len(s) == 0 { | ||
return nil | ||
} | ||
|
||
res := make(GPUInfoS, 0, len(s)) | ||
|
||
for _, n := range s { | ||
res = append(res, GPUInfo{ | ||
Vendor: n.Vendor, | ||
Name: n.Name, | ||
ModelID: n.ModelID, | ||
Interface: n.Interface, | ||
MemorySize: n.MemorySize, | ||
}) | ||
} | ||
|
||
return res | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package v1 | ||
|
||
func (r *Memory) Dup() Memory { | ||
res := Memory{ | ||
Quantity: r.Quantity.Dup(), | ||
Info: r.Info.Dup(), | ||
} | ||
|
||
return res | ||
} | ||
|
||
func (s MemoryInfoS) Dup() MemoryInfoS { | ||
if len(s) == 0 { | ||
return nil | ||
} | ||
|
||
res := make(MemoryInfoS, 0, len(s)) | ||
|
||
for _, n := range s { | ||
res = append(res, MemoryInfo{ | ||
Vendor: n.Vendor, | ||
Type: n.Type, | ||
TotalSize: n.TotalSize, | ||
Speed: n.Speed, | ||
}) | ||
} | ||
|
||
return res | ||
} |
Oops, something went wrong.