events

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPolling = time.Millisecond * time.Duration(200)

Variables

This section is empty.

Functions

func DispatchEvent

func DispatchEvent(
	ctx context.Context,
	client *cdp.Client,
	objectID runtime.RemoteObjectID,
	eventName string,
) (values.Boolean, error)

Types

type Event added in v0.3.0

type Event int
var (
	//revive:disable-next-line var-declaration
	EventError                 Event = 0
	EventLoad                  Event = 1
	EventReload                Event = 2
	EventAttrModified          Event = 3
	EventAttrRemoved           Event = 4
	EventChildNodeCountUpdated Event = 5
	EventChildNodeInserted     Event = 6
	EventChildNodeRemoved      Event = 7
)

type EventBroker

type EventBroker struct {
	// contains filtered or unexported fields
}

func NewEventBroker

func NewEventBroker(
	onLoad page.LoadEventFiredClient,
	onReload dom.DocumentUpdatedClient,
	onAttrModified dom.AttributeModifiedClient,
	onAttrRemoved dom.AttributeRemovedClient,
	onChildNodeCountUpdated dom.ChildNodeCountUpdatedClient,
	onChildNodeInserted dom.ChildNodeInsertedClient,
	onChildNodeRemoved dom.ChildNodeRemovedClient,
) *EventBroker

func (*EventBroker) AddEventListener

func (broker *EventBroker) AddEventListener(event Event, listener EventListener)

func (*EventBroker) Close

func (broker *EventBroker) Close() error

func (*EventBroker) ListenerCount added in v0.3.0

func (broker *EventBroker) ListenerCount(event Event) int

func (*EventBroker) RemoveEventListener

func (broker *EventBroker) RemoveEventListener(event Event, listener EventListener)

func (*EventBroker) Start

func (broker *EventBroker) Start() error

func (*EventBroker) Stop

func (broker *EventBroker) Stop() error

type EventListener

type EventListener func(message interface{})

type Function

type Function func() (core.Value, error)

type WaitTask

type WaitTask struct {
	// contains filtered or unexported fields
}

func NewEvalWaitTask

func NewEvalWaitTask(
	client *cdp.Client,
	predicate string,
	timeout time.Duration,
	polling time.Duration,
) *WaitTask

func NewWaitTask

func NewWaitTask(
	fun Function,
	timeout time.Duration,
	polling time.Duration,
) *WaitTask

func (*WaitTask) Run

func (task *WaitTask) Run() (core.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL