forked from content-services/content-sources-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepository_rpms.go
47 lines (40 loc) · 1.89 KB
/
repository_rpms.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
package api
type RepositoryRpm struct {
UUID string `json:"uuid"` // Identifier of the rpm
Name string `json:"name"` // The rpm package name
Arch string `json:"arch"` // The Architecture of the rpm
Version string `json:"version"` // The version of the rpm
Release string `json:"release"` // The release of the rpm
Epoch int32 `json:"epoch"` // The epoch of the rpm
Summary string `json:"summary"` // The summary of the rpm
Checksum string `json:"checksum"` // The checksum of the rpm
}
type RepositoryRpmCollectionResponse struct {
Data []RepositoryRpm `json:"data"` // List of rpms
Meta ResponseMetadata `json:"meta"` // Metadata about the request
Links Links `json:"links"` // Links to other pages of results
}
type RepositoryRpmRequest struct {
UUID string `param:"uuid"` // Identifier of the repository
Search string `query:"search"` // Search string based query to optionally filter-on
SortBy string `query:"sort_by"` // SortBy sets the sort order of the result
}
type SearchRpmRequest struct {
URLs []string `json:"urls,omitempty"` // URLs of repositories to search
UUIDs []string `json:"uuids,omitempty"` // List of RepositoryConfig UUIDs to search
Search string `json:"search"` // Search string to search rpm names
Limit *int `json:"limit,omitempty"` // Maximum number of records to return for the search
}
const SearchRpmRequestLimitDefault int = 100
const SearchRpmRequestLimitMaximum int = 500
type SearchRpmResponse struct {
PackageName string `json:"package_name"` // Package name found
Summary string `json:"summary"` // Summary of the package found
}
// SetMetadata Map metadata to the collection.
// meta Metadata about the request.
// links Links to other pages of results.
func (r *RepositoryRpmCollectionResponse) SetMetadata(meta ResponseMetadata, links Links) {
r.Meta = meta
r.Links = links
}