-
Notifications
You must be signed in to change notification settings - Fork 0
/
show_system_properties.go
63 lines (49 loc) · 1.71 KB
/
show_system_properties.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package gpudb
import (
"context"
"go.opentelemetry.io/otel/trace"
)
func NewDefaultShowSystemPropertiesOptions() *ShowSystemPropertiesOptions {
return &ShowSystemPropertiesOptions{
Properties: "",
}
}
func (gpudb *Gpudb) buildShowSystemPropertiesOptionsMap(ctx context.Context, options *ShowSystemPropertiesOptions) *map[string]string {
var (
// childCtx context.Context
childSpan trace.Span
)
_, childSpan = gpudb.tracer.Start(ctx, "gpudb.buildShowSystemPropertiesOptionsMap()")
defer childSpan.End()
mapOptions := make(map[string]string)
if options.Properties != "" {
mapOptions["properties"] = options.Properties
}
return &mapOptions
}
func (gpudb *Gpudb) ShowSystemPropertiesRaw(ctx context.Context) (*ShowSystemPropertiesResponse, error) {
var (
childCtx context.Context
childSpan trace.Span
)
childCtx, childSpan = gpudb.tracer.Start(ctx, "gpudb.ShowSystemPropertiesRaw()")
defer childSpan.End()
return gpudb.ShowSystemPropertiesRawWithOpts(childCtx, NewDefaultShowSystemPropertiesOptions())
}
func (gpudb *Gpudb) ShowSystemPropertiesRawWithOpts(
ctx context.Context, options *ShowSystemPropertiesOptions) (*ShowSystemPropertiesResponse, error) {
var (
childCtx context.Context
childSpan trace.Span
)
childCtx, childSpan = gpudb.tracer.Start(ctx, "gpudb.ShowSystemPropertiesRawWithOpts()")
defer childSpan.End()
mapOptions := gpudb.buildShowSystemPropertiesOptionsMap(childCtx, options)
response := ShowSystemPropertiesResponse{}
request := ShowSystemPropertiesRequest{Options: *mapOptions}
err := gpudb.submitRawRequest(
childCtx, "/show/system/properties",
&Schemas.showSystemPropertiesRequest, &Schemas.showSystemPropertiesResponse,
&request, &response)
return &response, err
}