2017-01-24 15:09:23 +00:00
|
|
|
// Package storage provides the Chrome Debugging Protocol
|
2017-02-12 04:59:33 +00:00
|
|
|
// commands, types, and events for the Storage domain.
|
2017-01-24 15:09:23 +00:00
|
|
|
//
|
|
|
|
// Generated by the chromedp-gen command.
|
|
|
|
package storage
|
|
|
|
|
2017-07-09 02:05:19 +00:00
|
|
|
// Code generated by chromedp-gen. DO NOT EDIT.
|
2017-01-24 15:09:23 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2017-01-26 07:28:34 +00:00
|
|
|
cdp "github.com/knq/chromedp/cdp"
|
2017-01-24 15:09:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ClearDataForOriginParams clears storage for origin.
|
|
|
|
type ClearDataForOriginParams struct {
|
|
|
|
Origin string `json:"origin"` // Security origin.
|
|
|
|
StorageTypes string `json:"storageTypes"` // Comma separated origin names.
|
|
|
|
}
|
|
|
|
|
|
|
|
// ClearDataForOrigin clears storage for origin.
|
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// origin - Security origin.
|
|
|
|
// storageTypes - Comma separated origin names.
|
|
|
|
func ClearDataForOrigin(origin string, storageTypes string) *ClearDataForOriginParams {
|
|
|
|
return &ClearDataForOriginParams{
|
|
|
|
Origin: origin,
|
|
|
|
StorageTypes: storageTypes,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-12 04:59:33 +00:00
|
|
|
// Do executes Storage.clearDataForOrigin against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *ClearDataForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
2017-02-14 08:41:23 +00:00
|
|
|
return h.Execute(ctxt, cdp.CommandStorageClearDataForOrigin, p, nil)
|
2017-01-24 15:09:23 +00:00
|
|
|
}
|
2017-06-18 00:55:45 +00:00
|
|
|
|
|
|
|
// GetUsageAndQuotaParams returns usage and quota in bytes.
|
|
|
|
type GetUsageAndQuotaParams struct {
|
|
|
|
Origin string `json:"origin"` // Security origin.
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetUsageAndQuota returns usage and quota in bytes.
|
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// origin - Security origin.
|
|
|
|
func GetUsageAndQuota(origin string) *GetUsageAndQuotaParams {
|
|
|
|
return &GetUsageAndQuotaParams{
|
|
|
|
Origin: origin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetUsageAndQuotaReturns return values.
|
|
|
|
type GetUsageAndQuotaReturns struct {
|
2017-06-23 02:00:24 +00:00
|
|
|
Usage float64 `json:"usage,omitempty"` // Storage usage (bytes).
|
|
|
|
Quota float64 `json:"quota,omitempty"` // Storage quota (bytes).
|
|
|
|
UsageBreakdown []*UsageForType `json:"usageBreakdown,omitempty"` // Storage usage per type (bytes).
|
2017-06-18 00:55:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Do executes Storage.getUsageAndQuota against the provided context and
|
|
|
|
// target handler.
|
|
|
|
//
|
|
|
|
// returns:
|
|
|
|
// usage - Storage usage (bytes).
|
|
|
|
// quota - Storage quota (bytes).
|
2017-06-23 02:00:24 +00:00
|
|
|
// usageBreakdown - Storage usage per type (bytes).
|
|
|
|
func (p *GetUsageAndQuotaParams) Do(ctxt context.Context, h cdp.Handler) (usage float64, quota float64, usageBreakdown []*UsageForType, err error) {
|
2017-06-18 00:55:45 +00:00
|
|
|
// execute
|
|
|
|
var res GetUsageAndQuotaReturns
|
|
|
|
err = h.Execute(ctxt, cdp.CommandStorageGetUsageAndQuota, p, &res)
|
|
|
|
if err != nil {
|
2017-06-23 02:00:24 +00:00
|
|
|
return 0, 0, nil, err
|
2017-06-18 00:55:45 +00:00
|
|
|
}
|
|
|
|
|
2017-06-23 02:00:24 +00:00
|
|
|
return res.Usage, res.Quota, res.UsageBreakdown, nil
|
2017-06-18 00:55:45 +00:00
|
|
|
}
|
2017-08-20 23:56:21 +00:00
|
|
|
|
|
|
|
// TrackCacheStorageForOriginParams registers origin to be notified when an
|
|
|
|
// update occurs to its cache storage list.
|
|
|
|
type TrackCacheStorageForOriginParams struct {
|
|
|
|
Origin string `json:"origin"` // Security origin.
|
|
|
|
}
|
|
|
|
|
|
|
|
// TrackCacheStorageForOrigin registers origin to be notified when an update
|
|
|
|
// occurs to its cache storage list.
|
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// origin - Security origin.
|
|
|
|
func TrackCacheStorageForOrigin(origin string) *TrackCacheStorageForOriginParams {
|
|
|
|
return &TrackCacheStorageForOriginParams{
|
|
|
|
Origin: origin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do executes Storage.trackCacheStorageForOrigin against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *TrackCacheStorageForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
|
|
|
return h.Execute(ctxt, cdp.CommandStorageTrackCacheStorageForOrigin, p, nil)
|
|
|
|
}
|
|
|
|
|
2017-12-18 00:23:14 +00:00
|
|
|
// TrackIndexedDBForOriginParams registers origin to be notified when an
|
|
|
|
// update occurs to its IndexedDB.
|
|
|
|
type TrackIndexedDBForOriginParams struct {
|
2017-08-20 23:56:21 +00:00
|
|
|
Origin string `json:"origin"` // Security origin.
|
|
|
|
}
|
|
|
|
|
2017-12-18 00:23:14 +00:00
|
|
|
// TrackIndexedDBForOrigin registers origin to be notified when an update
|
|
|
|
// occurs to its IndexedDB.
|
2017-08-20 23:56:21 +00:00
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// origin - Security origin.
|
2017-12-18 00:23:14 +00:00
|
|
|
func TrackIndexedDBForOrigin(origin string) *TrackIndexedDBForOriginParams {
|
|
|
|
return &TrackIndexedDBForOriginParams{
|
2017-08-20 23:56:21 +00:00
|
|
|
Origin: origin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-18 00:23:14 +00:00
|
|
|
// Do executes Storage.trackIndexedDBForOrigin against the provided context and
|
2017-08-20 23:56:21 +00:00
|
|
|
// target handler.
|
2017-12-18 00:23:14 +00:00
|
|
|
func (p *TrackIndexedDBForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
|
|
|
return h.Execute(ctxt, cdp.CommandStorageTrackIndexedDBForOrigin, p, nil)
|
2017-08-20 23:56:21 +00:00
|
|
|
}
|
2017-09-30 01:27:51 +00:00
|
|
|
|
2017-12-18 00:23:14 +00:00
|
|
|
// UntrackCacheStorageForOriginParams unregisters origin from receiving
|
|
|
|
// notifications for cache storage.
|
|
|
|
type UntrackCacheStorageForOriginParams struct {
|
2017-09-30 01:27:51 +00:00
|
|
|
Origin string `json:"origin"` // Security origin.
|
|
|
|
}
|
|
|
|
|
2017-12-18 00:23:14 +00:00
|
|
|
// UntrackCacheStorageForOrigin unregisters origin from receiving
|
|
|
|
// notifications for cache storage.
|
2017-09-30 01:27:51 +00:00
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// origin - Security origin.
|
2017-12-18 00:23:14 +00:00
|
|
|
func UntrackCacheStorageForOrigin(origin string) *UntrackCacheStorageForOriginParams {
|
|
|
|
return &UntrackCacheStorageForOriginParams{
|
2017-09-30 01:27:51 +00:00
|
|
|
Origin: origin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-18 00:23:14 +00:00
|
|
|
// Do executes Storage.untrackCacheStorageForOrigin against the provided context and
|
2017-09-30 01:27:51 +00:00
|
|
|
// target handler.
|
2017-12-18 00:23:14 +00:00
|
|
|
func (p *UntrackCacheStorageForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
|
|
|
return h.Execute(ctxt, cdp.CommandStorageUntrackCacheStorageForOrigin, p, nil)
|
2017-09-30 01:27:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UntrackIndexedDBForOriginParams unregisters origin from receiving
|
|
|
|
// notifications for IndexedDB.
|
|
|
|
type UntrackIndexedDBForOriginParams struct {
|
|
|
|
Origin string `json:"origin"` // Security origin.
|
|
|
|
}
|
|
|
|
|
|
|
|
// UntrackIndexedDBForOrigin unregisters origin from receiving notifications
|
|
|
|
// for IndexedDB.
|
|
|
|
//
|
|
|
|
// parameters:
|
|
|
|
// origin - Security origin.
|
|
|
|
func UntrackIndexedDBForOrigin(origin string) *UntrackIndexedDBForOriginParams {
|
|
|
|
return &UntrackIndexedDBForOriginParams{
|
|
|
|
Origin: origin,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do executes Storage.untrackIndexedDBForOrigin against the provided context and
|
|
|
|
// target handler.
|
|
|
|
func (p *UntrackIndexedDBForOriginParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
|
|
|
|
return h.Execute(ctxt, cdp.CommandStorageUntrackIndexedDBForOrigin, p, nil)
|
|
|
|
}
|