chromedp/cdp/domstorage/domstorage.go

156 lines
4.1 KiB
Go
Raw Normal View History

2017-01-24 15:09:23 +00:00
// Package domstorage provides the Chrome Debugging Protocol
// commands, types, and events for the DOMStorage domain.
2017-01-24 15:09:23 +00:00
//
// Query and modify DOM storage.
//
// Generated by the chromedp-gen command.
package domstorage
// 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
)
2017-12-18 00:23:14 +00:00
// ClearParams [no description].
type ClearParams struct {
StorageID *StorageID `json:"storageId"`
}
2017-01-24 15:09:23 +00:00
2017-12-18 00:23:14 +00:00
// Clear [no description].
//
// parameters:
// storageID
func Clear(storageID *StorageID) *ClearParams {
return &ClearParams{
StorageID: storageID,
}
2017-01-24 15:09:23 +00:00
}
2017-12-18 00:23:14 +00:00
// Do executes DOMStorage.clear against the provided context and
// target handler.
2017-12-18 00:23:14 +00:00
func (p *ClearParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDOMStorageClear, p, nil)
2017-01-24 15:09:23 +00:00
}
// DisableParams disables storage tracking, prevents storage events from
// being sent to the client.
type DisableParams struct{}
// Disable disables storage tracking, prevents storage events from being sent
// to the client.
func Disable() *DisableParams {
return &DisableParams{}
}
// Do executes DOMStorage.disable against the provided context and
// target handler.
func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDOMStorageDisable, nil, nil)
2017-01-24 15:09:23 +00:00
}
2017-12-18 00:23:14 +00:00
// EnableParams enables storage tracking, storage events will now be
// delivered to the client.
type EnableParams struct{}
2017-01-24 15:09:23 +00:00
2017-12-18 00:23:14 +00:00
// Enable enables storage tracking, storage events will now be delivered to
// the client.
func Enable() *EnableParams {
return &EnableParams{}
2017-01-24 15:09:23 +00:00
}
2017-12-18 00:23:14 +00:00
// Do executes DOMStorage.enable against the provided context and
// target handler.
2017-12-18 00:23:14 +00:00
func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDOMStorageEnable, nil, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// GetDOMStorageItemsParams [no description].
2017-01-24 15:09:23 +00:00
type GetDOMStorageItemsParams struct {
StorageID *StorageID `json:"storageId"`
}
2017-01-26 07:28:34 +00:00
// GetDOMStorageItems [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
2017-01-26 07:28:34 +00:00
// storageID
func GetDOMStorageItems(storageID *StorageID) *GetDOMStorageItemsParams {
2017-01-24 15:09:23 +00:00
return &GetDOMStorageItemsParams{
2017-01-26 07:28:34 +00:00
StorageID: storageID,
2017-01-24 15:09:23 +00:00
}
}
// GetDOMStorageItemsReturns return values.
type GetDOMStorageItemsReturns struct {
Entries []Item `json:"entries,omitempty"`
}
// Do executes DOMStorage.getDOMStorageItems against the provided context and
// target handler.
2017-01-24 15:09:23 +00:00
//
// returns:
// entries
func (p *GetDOMStorageItemsParams) Do(ctxt context.Context, h cdp.Handler) (entries []Item, err error) {
// execute
var res GetDOMStorageItemsReturns
err = h.Execute(ctxt, cdp.CommandDOMStorageGetDOMStorageItems, p, &res)
2017-01-24 15:09:23 +00:00
if err != nil {
return nil, err
}
return res.Entries, nil
2017-01-24 15:09:23 +00:00
}
2017-12-18 00:23:14 +00:00
// RemoveDOMStorageItemParams [no description].
type RemoveDOMStorageItemParams struct {
2017-01-24 15:09:23 +00:00
StorageID *StorageID `json:"storageId"`
Key string `json:"key"`
}
2017-12-18 00:23:14 +00:00
// RemoveDOMStorageItem [no description].
2017-01-26 07:28:34 +00:00
//
2017-01-24 15:09:23 +00:00
// parameters:
2017-01-26 07:28:34 +00:00
// storageID
2017-01-24 15:09:23 +00:00
// key
2017-12-18 00:23:14 +00:00
func RemoveDOMStorageItem(storageID *StorageID, key string) *RemoveDOMStorageItemParams {
return &RemoveDOMStorageItemParams{
2017-01-26 07:28:34 +00:00
StorageID: storageID,
2017-01-24 15:09:23 +00:00
Key: key,
}
}
2017-12-18 00:23:14 +00:00
// Do executes DOMStorage.removeDOMStorageItem against the provided context and
// target handler.
2017-12-18 00:23:14 +00:00
func (p *RemoveDOMStorageItemParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDOMStorageRemoveDOMStorageItem, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-12-18 00:23:14 +00:00
// SetDOMStorageItemParams [no description].
type SetDOMStorageItemParams struct {
2017-01-24 15:09:23 +00:00
StorageID *StorageID `json:"storageId"`
Key string `json:"key"`
2017-12-18 00:23:14 +00:00
Value string `json:"value"`
2017-01-24 15:09:23 +00:00
}
2017-12-18 00:23:14 +00:00
// SetDOMStorageItem [no description].
2017-01-26 07:28:34 +00:00
//
2017-01-24 15:09:23 +00:00
// parameters:
2017-01-26 07:28:34 +00:00
// storageID
2017-01-24 15:09:23 +00:00
// key
2017-12-18 00:23:14 +00:00
// value
func SetDOMStorageItem(storageID *StorageID, key string, value string) *SetDOMStorageItemParams {
return &SetDOMStorageItemParams{
2017-01-26 07:28:34 +00:00
StorageID: storageID,
2017-01-24 15:09:23 +00:00
Key: key,
2017-12-18 00:23:14 +00:00
Value: value,
2017-01-24 15:09:23 +00:00
}
}
2017-12-18 00:23:14 +00:00
// Do executes DOMStorage.setDOMStorageItem against the provided context and
// target handler.
2017-12-18 00:23:14 +00:00
func (p *SetDOMStorageItemParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandDOMStorageSetDOMStorageItem, p, nil)
2017-01-24 15:09:23 +00:00
}