events

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

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(ctx context.Context, message interface{})

type Function

type Function func(ctx context.Context) (core.Value, error)

type WaitTask

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

func NewEvalWaitTask

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

func NewValueWaitTask added in v0.7.0

func NewValueWaitTask(
	when drivers.WaitEvent,
	value core.Value,
	getter Function,
	polling time.Duration,
) *WaitTask

func NewWaitTask

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

func (*WaitTask) Run

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

Jump to

Keyboard shortcuts

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