fixup

package
v0.0.0-...-ccdd204 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fixup modifies/alters/fixes and adds to the low level type definitions for the Chrome Debugging Protocol domains, as generated from protocol.json.

The goal of package fixup is to fix the issues associated with generating Go code from the existing Chrome domain definitions, and is wrapped up in one high-level func, FixDomains.

Currently, FixDomains will do the following:

  • add 'Inspector.MethodType' type as a string enumeration of all the event/command names.
  • add 'Inspector.MessageError' type as a object with code (integer), and message (string).
  • add 'Inspector.Message' type as a object with id (integer), method (MethodType), params (interface{}), error (MessageError).
  • add 'Inspector.DetachReason' type and change event 'Inspector.detached”s parameter reason's type.
  • add 'Inspector.ErrorType' type.
  • change type of Network.Timestamp and Runtime.Timestamp to internal Timestamp type.
  • add 'Page.Bootstamp' type and convert all command/event parameters named 'timestamp' in the Page domain to the Bootstamp type.
  • change any object property or command/event parameter named 'timestamp' that doesn't have a $ref defined to 'Network.Timestamp'.
  • convert object properties and event/command parameters that are enums into independent types.
  • change '*.modifiers' parameters to type Input.Modifier.
  • add 'DOM.NodeType' type and convert "nodeType" parameters to it.
  • change Page.Frame.id/parentID to FrameID type.
  • add additional properties to 'Page.Frame' and 'DOM.Node' for use by higher level packages.
  • add special unmarshaler to NodeId, BackendNodeId, FrameId to handle values from older (v1.1) protocol versions. -- NOTE: this might need to be applied to more types, such as network.LoaderId
  • rename 'Input.GestureSourceType' -> 'Input.GestureType'.
  • rename CSS.CSS* types.
  • add Error() method to 'Runtime.ExceptionDetails' type so that it can be used as error.
  • change 'Network.Headers' type to map[string]interface{}.

Please note that the above is not an exhaustive list of all modifications applied to the domains, however it does attempt to give a comprehensive overview of the most important changes to the definition vs the vanilla specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixDomains

func FixDomains(domains []*internal.Domain)

FixDomains modifies, updates, alters, fixes, and adds to the types defined in the domains, so that the generated Chrome Debugging Protocol domain code is more Go-like and easier to use.

Please see package-level documentation for the list of changes made to the various debugging protocol domains.

Types

This section is empty.

Jump to

Keyboard shortcuts

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