-
Notifications
You must be signed in to change notification settings - Fork 255
/
version_check_payload.go
41 lines (36 loc) · 1.17 KB
/
version_check_payload.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
package plugin
import "fmt"
type versionCheckPayload interface {
getMapKey() string
}
// the payload that travels to-and-fro between steampipe and the server
type versionCheckRequestPayload struct {
Org string `json:"org"`
Name string `json:"name"`
Stream string `json:"stream"`
Version string `json:"version"`
Digest string `json:"digest"`
}
func (v *versionCheckRequestPayload) getMapKey() string {
return fmt.Sprintf("%s/%s/%s", v.Org, v.Name, v.Stream)
}
type responseManifestAnnotations map[string]string
type responseManifestConfig struct {
MediaType string `json:"mediaType"`
Digest string `json:"digest"`
Size int `json:"size"`
}
type responseManifestLayer struct {
responseManifestConfig
Annotations responseManifestAnnotations `json:"annotations"`
}
type responseManifest struct {
SchemaVersion int `json:"schemaVersion"`
Config responseManifestConfig `json:"config"`
Layers []responseManifestLayer `json:"layers"`
Annotations responseManifestAnnotations `json:"annotations"`
}
type versionCheckResponsePayload struct {
versionCheckRequestPayload
Manifest responseManifest `json:"manifest"`
}