-
Notifications
You must be signed in to change notification settings - Fork 170
/
model.go
115 lines (94 loc) · 2.6 KB
/
model.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package registry
import (
"time"
)
// Notification holds all events.
type Notification struct {
Events []Event
}
// Event holds the details of a event.
type Event struct {
ID string `json:"Id"`
TimeStamp time.Time
Action string
Target *Target
Request *Request
Actor *Actor
}
// Target holds information about the target of a event.
type Target struct {
MediaType string
Digest string
Repository string
URL string `json:"Url"`
}
// Actor holds information about actor.
type Actor struct {
Name string
}
// Request holds information about a request.
type Request struct {
ID string `json:"Id"`
Method string
UserAgent string
}
type Namespace struct {
Namespace string `json:"Namespace"`
}
type NamespaceEmail struct {
ID uint64
CreatedAt time.Time
UpdatedAt time.Time
Namespace string `json:"Namespace" gorm:"not null" sql:"unique"`
AccountEmail string `json:"AccountEmail" gorm:"not null" sql:"unique"`
}
type Image struct {
ID uint64
CreatedAt time.Time
UpdatedAt time.Time
LatestTag string `json:"LatestTag"`
Namespace string `json:"Namespace" gorm:"not null"`
Image string `json:"Image" gorm:"not null"`
Publicity uint8 `json:"Publicity" gorm:"not null default 0"`
PushCount int64 `json:"PushCount" gorm:"-"`
PullCount int64 `json:"PullCount" gorm:"-"`
}
type Tag struct {
ID uint64
CreatedAt time.Time
UpdatedAt time.Time
Digest string `json:"Digest"`
Tag string `json:"Tag"`
Namespace string `json:"Namespace" gorm:"not null"`
Image string `json:"Image" gorm:"not null"`
Size uint64 `json:"Size"`
PushCount int64 `json:"PushCount" gorm:"-"`
PullCount int64 `json:"PullCount" gorm:"-"`
}
type ImageAccess struct {
ID uint64
CreatedAt time.Time
UpdatedAt time.Time
Namespace string `json:"Namespace" gorm:"not null"`
Image string `json:"Image" gorm:"not null"`
Digest string `json:"Digest"`
AccountEmail string `json:"AccountEmail"`
Action string `json:"Action"`
}
type V2RegistryResponse struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType"`
Config V2RegistryResponseConfig `json:"config"`
Layers V2RegistryResponseLayers `json:"layers"`
}
type V2RegistryResponseConfig struct {
MediaType string `json:"mediaType"`
Size uint64 `json:"size"`
Digest string `json:"digest"`
}
type V2RegistryResponseLayers []V2RegistryResponseLayer
type V2RegistryResponseLayer struct {
MediaType string `json:"mediaType"`
Size uint64 `json:"size"`
Digest string `json:"digest"`
}