chromedp/cdp/serviceworker/serviceworker.go

260 lines
7.1 KiB
Go
Raw Normal View History

2017-01-24 15:09:23 +00:00
// Package serviceworker provides the Chrome Debugging Protocol
// commands, types, and events for the ServiceWorker domain.
2017-01-24 15:09:23 +00:00
//
// Generated by the chromedp-gen command.
package serviceworker
// 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-01-26 07:28:34 +00:00
// EnableParams [no description].
2017-01-24 15:09:23 +00:00
type EnableParams struct{}
2017-01-26 07:28:34 +00:00
// Enable [no description].
2017-01-24 15:09:23 +00:00
func Enable() *EnableParams {
return &EnableParams{}
}
// Do executes ServiceWorker.enable against the provided context and
// target handler.
func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerEnable, nil, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// DisableParams [no description].
2017-01-24 15:09:23 +00:00
type DisableParams struct{}
2017-01-26 07:28:34 +00:00
// Disable [no description].
2017-01-24 15:09:23 +00:00
func Disable() *DisableParams {
return &DisableParams{}
}
// Do executes ServiceWorker.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.CommandServiceWorkerDisable, nil, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// UnregisterParams [no description].
2017-01-24 15:09:23 +00:00
type UnregisterParams struct {
ScopeURL string `json:"scopeURL"`
}
2017-01-26 07:28:34 +00:00
// Unregister [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// scopeURL
func Unregister(scopeURL string) *UnregisterParams {
return &UnregisterParams{
ScopeURL: scopeURL,
}
}
// Do executes ServiceWorker.unregister against the provided context and
// target handler.
func (p *UnregisterParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerUnregister, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// UpdateRegistrationParams [no description].
2017-01-24 15:09:23 +00:00
type UpdateRegistrationParams struct {
ScopeURL string `json:"scopeURL"`
}
2017-01-26 07:28:34 +00:00
// UpdateRegistration [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// scopeURL
func UpdateRegistration(scopeURL string) *UpdateRegistrationParams {
return &UpdateRegistrationParams{
ScopeURL: scopeURL,
}
}
// Do executes ServiceWorker.updateRegistration against the provided context and
// target handler.
func (p *UpdateRegistrationParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerUpdateRegistration, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// StartWorkerParams [no description].
2017-01-24 15:09:23 +00:00
type StartWorkerParams struct {
ScopeURL string `json:"scopeURL"`
}
2017-01-26 07:28:34 +00:00
// StartWorker [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// scopeURL
func StartWorker(scopeURL string) *StartWorkerParams {
return &StartWorkerParams{
ScopeURL: scopeURL,
}
}
// Do executes ServiceWorker.startWorker against the provided context and
// target handler.
func (p *StartWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerStartWorker, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// SkipWaitingParams [no description].
2017-01-24 15:09:23 +00:00
type SkipWaitingParams struct {
ScopeURL string `json:"scopeURL"`
}
2017-01-26 07:28:34 +00:00
// SkipWaiting [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// scopeURL
func SkipWaiting(scopeURL string) *SkipWaitingParams {
return &SkipWaitingParams{
ScopeURL: scopeURL,
}
}
// Do executes ServiceWorker.skipWaiting against the provided context and
// target handler.
func (p *SkipWaitingParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerSkipWaiting, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// StopWorkerParams [no description].
2017-01-24 15:09:23 +00:00
type StopWorkerParams struct {
VersionID string `json:"versionId"`
}
2017-01-26 07:28:34 +00:00
// StopWorker [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
2017-01-26 07:28:34 +00:00
// versionID
func StopWorker(versionID string) *StopWorkerParams {
2017-01-24 15:09:23 +00:00
return &StopWorkerParams{
2017-01-26 07:28:34 +00:00
VersionID: versionID,
2017-01-24 15:09:23 +00:00
}
}
// Do executes ServiceWorker.stopWorker against the provided context and
// target handler.
func (p *StopWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerStopWorker, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-09-15 23:52:13 +00:00
// StopAllWorkersParams [no description].
type StopAllWorkersParams struct{}
// StopAllWorkers [no description].
func StopAllWorkers() *StopAllWorkersParams {
return &StopAllWorkersParams{}
}
// Do executes ServiceWorker.stopAllWorkers against the provided context and
// target handler.
func (p *StopAllWorkersParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerStopAllWorkers, nil, nil)
}
2017-01-26 07:28:34 +00:00
// InspectWorkerParams [no description].
2017-01-24 15:09:23 +00:00
type InspectWorkerParams struct {
VersionID string `json:"versionId"`
}
2017-01-26 07:28:34 +00:00
// InspectWorker [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
2017-01-26 07:28:34 +00:00
// versionID
func InspectWorker(versionID string) *InspectWorkerParams {
2017-01-24 15:09:23 +00:00
return &InspectWorkerParams{
2017-01-26 07:28:34 +00:00
VersionID: versionID,
2017-01-24 15:09:23 +00:00
}
}
// Do executes ServiceWorker.inspectWorker against the provided context and
// target handler.
func (p *InspectWorkerParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerInspectWorker, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// SetForceUpdateOnPageLoadParams [no description].
2017-01-24 15:09:23 +00:00
type SetForceUpdateOnPageLoadParams struct {
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
}
2017-01-26 07:28:34 +00:00
// SetForceUpdateOnPageLoad [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// forceUpdateOnPageLoad
func SetForceUpdateOnPageLoad(forceUpdateOnPageLoad bool) *SetForceUpdateOnPageLoadParams {
return &SetForceUpdateOnPageLoadParams{
ForceUpdateOnPageLoad: forceUpdateOnPageLoad,
}
}
// Do executes ServiceWorker.setForceUpdateOnPageLoad against the provided context and
// target handler.
func (p *SetForceUpdateOnPageLoadParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerSetForceUpdateOnPageLoad, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// DeliverPushMessageParams [no description].
2017-01-24 15:09:23 +00:00
type DeliverPushMessageParams struct {
Origin string `json:"origin"`
RegistrationID string `json:"registrationId"`
Data string `json:"data"`
}
2017-01-26 07:28:34 +00:00
// DeliverPushMessage [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// origin
2017-01-26 07:28:34 +00:00
// registrationID
2017-01-24 15:09:23 +00:00
// data
2017-01-26 07:28:34 +00:00
func DeliverPushMessage(origin string, registrationID string, data string) *DeliverPushMessageParams {
2017-01-24 15:09:23 +00:00
return &DeliverPushMessageParams{
Origin: origin,
2017-01-26 07:28:34 +00:00
RegistrationID: registrationID,
2017-01-24 15:09:23 +00:00
Data: data,
}
}
// Do executes ServiceWorker.deliverPushMessage against the provided context and
// target handler.
func (p *DeliverPushMessageParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerDeliverPushMessage, p, nil)
2017-01-24 15:09:23 +00:00
}
2017-01-26 07:28:34 +00:00
// DispatchSyncEventParams [no description].
2017-01-24 15:09:23 +00:00
type DispatchSyncEventParams struct {
Origin string `json:"origin"`
RegistrationID string `json:"registrationId"`
Tag string `json:"tag"`
LastChance bool `json:"lastChance"`
}
2017-01-26 07:28:34 +00:00
// DispatchSyncEvent [no description].
//
2017-01-24 15:09:23 +00:00
// parameters:
// origin
2017-01-26 07:28:34 +00:00
// registrationID
2017-01-24 15:09:23 +00:00
// tag
// lastChance
2017-01-26 07:28:34 +00:00
func DispatchSyncEvent(origin string, registrationID string, tag string, lastChance bool) *DispatchSyncEventParams {
2017-01-24 15:09:23 +00:00
return &DispatchSyncEventParams{
Origin: origin,
2017-01-26 07:28:34 +00:00
RegistrationID: registrationID,
2017-01-24 15:09:23 +00:00
Tag: tag,
LastChance: lastChance,
}
}
// Do executes ServiceWorker.dispatchSyncEvent against the provided context and
// target handler.
func (p *DispatchSyncEventParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandServiceWorkerDispatchSyncEvent, p, nil)
2017-01-24 15:09:23 +00:00
}