// Package cachestorage provides the Chrome DevTools Protocol // commands, types, and events for the CacheStorage domain. // // Generated by the cdproto-gen command.
package cachestorage // Code generated by cdproto-gen. DO NOT EDIT. import ( ) // DeleteCacheParams deletes a cache. type DeleteCacheParams struct { CacheID CacheID `json:"cacheId"` // Id of cache for deletion. } // DeleteCache deletes a cache. // // See: https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage#method-deleteCache // // parameters: // // cacheID - Id of cache for deletion. func ( CacheID) *DeleteCacheParams { return &DeleteCacheParams{ CacheID: , } } // Do executes CacheStorage.deleteCache against the provided context. func ( *DeleteCacheParams) ( context.Context) ( error) { return cdp.Execute(, CommandDeleteCache, , nil) } // DeleteEntryParams deletes a cache entry. type DeleteEntryParams struct { CacheID CacheID `json:"cacheId"` // Id of cache where the entry will be deleted. Request string `json:"request"` // URL spec of the request. } // DeleteEntry deletes a cache entry. // // See: https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage#method-deleteEntry // // parameters: // // cacheID - Id of cache where the entry will be deleted. // request - URL spec of the request. func ( CacheID, string) *DeleteEntryParams { return &DeleteEntryParams{ CacheID: , Request: , } } // Do executes CacheStorage.deleteEntry against the provided context. func ( *DeleteEntryParams) ( context.Context) ( error) { return cdp.Execute(, CommandDeleteEntry, , nil) } // RequestCacheNamesParams requests cache names. type RequestCacheNamesParams struct { SecurityOrigin string `json:"securityOrigin,omitempty"` // At least and at most one of securityOrigin, storageKey, storageBucket must be specified. Security origin. StorageKey string `json:"storageKey,omitempty"` // Storage key. StorageBucket *storage.Bucket `json:"storageBucket,omitempty"` // Storage bucket. If not specified, it uses the default bucket. } // RequestCacheNames requests cache names. // // See: https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage#method-requestCacheNames // // parameters: func () *RequestCacheNamesParams { return &RequestCacheNamesParams{} } // WithSecurityOrigin at least and at most one of securityOrigin, storageKey, // storageBucket must be specified. Security origin. func ( RequestCacheNamesParams) ( string) *RequestCacheNamesParams { .SecurityOrigin = return & } // WithStorageKey storage key. func ( RequestCacheNamesParams) ( string) *RequestCacheNamesParams { .StorageKey = return & } // WithStorageBucket storage bucket. If not specified, it uses the default // bucket. func ( RequestCacheNamesParams) ( *storage.Bucket) *RequestCacheNamesParams { .StorageBucket = return & } // RequestCacheNamesReturns return values. type RequestCacheNamesReturns struct { Caches []*Cache `json:"caches,omitempty"` // Caches for the security origin. } // Do executes CacheStorage.requestCacheNames against the provided context. // // returns: // // caches - Caches for the security origin. func ( *RequestCacheNamesParams) ( context.Context) ( []*Cache, error) { // execute var RequestCacheNamesReturns = cdp.Execute(, CommandRequestCacheNames, , &) if != nil { return nil, } return .Caches, nil } // RequestCachedResponseParams fetches cache entry. type RequestCachedResponseParams 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. } // RequestCachedResponse fetches cache entry. // // See: https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage#method-requestCachedResponse // // parameters: // // cacheID - Id of cache that contains the entry. // requestURL - URL spec of the request. // requestHeaders - headers of the request. func ( CacheID, string, []*Header) *RequestCachedResponseParams { return &RequestCachedResponseParams{ CacheID: , RequestURL: , RequestHeaders: , } } // RequestCachedResponseReturns return values. type RequestCachedResponseReturns struct { Response *CachedResponse `json:"response,omitempty"` // Response read from the cache. } // Do executes CacheStorage.requestCachedResponse against the provided context. // // returns: // // response - Response read from the cache. func ( *RequestCachedResponseParams) ( context.Context) ( *CachedResponse, error) { // execute var RequestCachedResponseReturns = cdp.Execute(, CommandRequestCachedResponse, , &) if != nil { return nil, } return .Response, nil } // RequestEntriesParams requests data from cache. type RequestEntriesParams struct { CacheID CacheID `json:"cacheId"` // ID of cache to get entries from. SkipCount int64 `json:"skipCount,omitempty"` // Number of records to skip. PageSize int64 `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 } // RequestEntries requests data from cache. // // See: https://chromedevtools.github.io/devtools-protocol/tot/CacheStorage#method-requestEntries // // parameters: // // cacheID - ID of cache to get entries from. func ( CacheID) *RequestEntriesParams { return &RequestEntriesParams{ CacheID: , } } // WithSkipCount number of records to skip. func ( RequestEntriesParams) ( int64) *RequestEntriesParams { .SkipCount = return & } // WithPageSize number of records to fetch. func ( RequestEntriesParams) ( int64) *RequestEntriesParams { .PageSize = return & } // WithPathFilter if present, only return the entries containing this // substring in the path. func ( RequestEntriesParams) ( string) *RequestEntriesParams { .PathFilter = return & } // RequestEntriesReturns return values. type RequestEntriesReturns struct { CacheDataEntries []*DataEntry `json:"cacheDataEntries,omitempty"` // Array of object store data entries. ReturnCount float64 `json:"returnCount,omitempty"` // Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage. } // Do executes CacheStorage.requestEntries against the provided context. // // returns: // // cacheDataEntries - Array of object store data entries. // returnCount - Count of returned entries from this storage. If pathFilter is empty, it is the count of all entries from this storage. func ( *RequestEntriesParams) ( context.Context) ( []*DataEntry, float64, error) { // execute var RequestEntriesReturns = cdp.Execute(, CommandRequestEntries, , &) if != nil { return nil, 0, } return .CacheDataEntries, .ReturnCount, nil } // Command names. const ( CommandDeleteCache = "CacheStorage.deleteCache" CommandDeleteEntry = "CacheStorage.deleteEntry" CommandRequestCacheNames = "CacheStorage.requestCacheNames" CommandRequestCachedResponse = "CacheStorage.requestCachedResponse" CommandRequestEntries = "CacheStorage.requestEntries" )