forked from nscuro/dtrack-client
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
about.go
38 lines (31 loc) · 841 Bytes
/
about.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
package dtrack
import (
"context"
"net/http"
"github.com/google/uuid"
)
type About struct {
UUID uuid.UUID `json:"uuid"`
SystemUUID uuid.UUID `json:"systemUuid"`
Application string `json:"application"`
Version string `json:"version"`
Timestamp string `json:"timestamp"`
Framework AboutFramework `json:"framework"`
}
type AboutFramework struct {
UUID uuid.UUID `json:"uuid"`
Name string `json:"name"`
Version string `json:"version"`
Timestamp string `json:"timestamp"`
}
type AboutService struct {
client *Client
}
func (as AboutService) Get(ctx context.Context) (a About, err error) {
req, err := as.client.newRequest(ctx, http.MethodGet, "/api/version", withoutAuth())
if err != nil {
return
}
_, err = as.client.doRequest(req, &a)
return
}