/
command.go
109 lines (92 loc) · 4.33 KB
/
command.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
// Code generated by cdpgen. DO NOT EDIT.
package cachestorage
// DeleteCacheArgs represents the arguments for DeleteCache in the CacheStorage domain.
type DeleteCacheArgs struct {
CacheID CacheID `json:"cacheId"` // Id of cache for deletion.
}
// NewDeleteCacheArgs initializes DeleteCacheArgs with the required arguments.
func NewDeleteCacheArgs(cacheID CacheID) *DeleteCacheArgs {
args := new(DeleteCacheArgs)
args.CacheID = cacheID
return args
}
// DeleteEntryArgs represents the arguments for DeleteEntry in the CacheStorage domain.
type DeleteEntryArgs struct {
CacheID CacheID `json:"cacheId"` // Id of cache where the entry will be deleted.
Request string `json:"request"` // URL spec of the request.
}
// NewDeleteEntryArgs initializes DeleteEntryArgs with the required arguments.
func NewDeleteEntryArgs(cacheID CacheID, request string) *DeleteEntryArgs {
args := new(DeleteEntryArgs)
args.CacheID = cacheID
args.Request = request
return args
}
// RequestCacheNamesArgs represents the arguments for RequestCacheNames in the CacheStorage domain.
type RequestCacheNamesArgs struct {
SecurityOrigin string `json:"securityOrigin"` // Security origin.
}
// NewRequestCacheNamesArgs initializes RequestCacheNamesArgs with the required arguments.
func NewRequestCacheNamesArgs(securityOrigin string) *RequestCacheNamesArgs {
args := new(RequestCacheNamesArgs)
args.SecurityOrigin = securityOrigin
return args
}
// RequestCacheNamesReply represents the return values for RequestCacheNames in the CacheStorage domain.
type RequestCacheNamesReply struct {
Caches []Cache `json:"caches"` // Caches for the security origin.
}
// RequestCachedResponseArgs represents the arguments for RequestCachedResponse in the CacheStorage domain.
type RequestCachedResponseArgs struct {
CacheID CacheID `json:"cacheId"` // Id of cache that contains the entry.
RequestURL string `json:"requestURL"` // URL spec of the request.
RequestHeaders []Header `json:"requestHeaders"` // headers of the request.
}
// NewRequestCachedResponseArgs initializes RequestCachedResponseArgs with the required arguments.
func NewRequestCachedResponseArgs(cacheID CacheID, requestURL string, requestHeaders []Header) *RequestCachedResponseArgs {
args := new(RequestCachedResponseArgs)
args.CacheID = cacheID
args.RequestURL = requestURL
args.RequestHeaders = requestHeaders
return args
}
// RequestCachedResponseReply represents the return values for RequestCachedResponse in the CacheStorage domain.
type RequestCachedResponseReply struct {
Response CachedResponse `json:"response"` // Response read from the cache.
}
// RequestEntriesArgs represents the arguments for RequestEntries in the CacheStorage domain.
type RequestEntriesArgs struct {
CacheID CacheID `json:"cacheId"` // ID of cache to get entries from.
SkipCount *int `json:"skipCount,omitempty"` // Number of records to skip.
PageSize *int `json:"pageSize,omitempty"` // Number of records to fetch.
PathFilter *string `json:"pathFilter,omitempty"` // If present, only return the entries containing this substring in the path
}
// NewRequestEntriesArgs initializes RequestEntriesArgs with the required arguments.
func NewRequestEntriesArgs(cacheID CacheID) *RequestEntriesArgs {
args := new(RequestEntriesArgs)
args.CacheID = cacheID
return args
}
// SetSkipCount sets the SkipCount optional argument. Number of
// records to skip.
func (a *RequestEntriesArgs) SetSkipCount(skipCount int) *RequestEntriesArgs {
a.SkipCount = &skipCount
return a
}
// SetPageSize sets the PageSize optional argument. Number of records
// to fetch.
func (a *RequestEntriesArgs) SetPageSize(pageSize int) *RequestEntriesArgs {
a.PageSize = &pageSize
return a
}
// SetPathFilter sets the PathFilter optional argument. If present,
// only return the entries containing this substring in the path
func (a *RequestEntriesArgs) SetPathFilter(pathFilter string) *RequestEntriesArgs {
a.PathFilter = &pathFilter
return a
}
// RequestEntriesReply represents the return values for RequestEntries in the CacheStorage domain.
type RequestEntriesReply struct {
CacheDataEntries []DataEntry `json:"cacheDataEntries"` // Array of object store data entries.
ReturnCount float64 `json:"returnCount"` // Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage.
}