Documentation ¶
Overview ¶
Package proto is used to parse the CDP protocol definitions (JSON).
Index ¶
- type AnyType
- func (at AnyType) Desc(indent, startOffset int) string
- func (at AnyType) ExportedName(d Domain) string
- func (at AnyType) GoType(pkg string, d Domain) string
- func (at AnyType) IsEnum() bool
- func (at AnyType) IsLocalEnum() bool
- func (at AnyType) Name(d Domain) string
- func (at AnyType) Recvr(d Domain) string
- type Command
- func (c Command) ArgsAssign(receiver string, d Domain) string
- func (c Command) ArgsInit(d Domain) string
- func (c Command) ArgsName(d Domain) string
- func (c Command) ArgsSignature(pkg string, d Domain) string
- func (c Command) CmdName(d Domain, export bool) string
- func (c Command) Desc(lineEndComment bool, indent, startOffset int) string
- func (c Command) Name() string
- func (c Command) ReplyAssign(receiver string, d Domain) string
- func (c Command) ReplyName(d Domain) string
- func (c Command) ReplySignature(d Domain) string
- type Domain
- type Enum
- type Event
- type Protocol
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyType ¶
type AnyType struct { IDName string `json:"id,omitempty"` NameName string `json:"name,omitempty"` Type string `json:"type,omitempty"` Description string `json:"description,omitempty"` Ref string `json:"$ref,omitempty"` Properties []AnyType `json:"properties,omitempty"` Enum []Enum `json:"enum,omitempty"` Items *AnyType `json:"items,omitempty"` MinItems int `json:"minItems,omitempty"` MaxItems int `json:"maxItems,omitempty"` Optional bool `json:"optional,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Experimental bool `json:"experimental,omitempty"` }
AnyType is a catch-all struct for properties, parameters, etc.
func (AnyType) ExportedName ¶
ExportedName returns an exported name.
func (AnyType) IsLocalEnum ¶ added in v0.9.1
IsLocalEnum returns true if type is enumerated without an exported type.
type Command ¶
type Command struct { NameName string `json:"name,omitempty"` Description string `json:"description,omitempty"` Parameters []AnyType `json:"parameters,omitempty"` Returns []AnyType `json:"returns,omitempty"` Optional bool `json:"optional,omitempty"` Experimental bool `json:"experimental,omitempty"` Redirect string `json:"redirect,omitempty"` Handlers []string `json:"handlers,omitempty"` Deprecated bool `json:"deprecated,omitempty"` }
Command represents a command belonging to a domain, e.g. Network.setCookie.
func (Command) ArgsAssign ¶
ArgsAssign returns the argument assignment for args.
func (Command) ArgsSignature ¶
ArgsSignature returns the signature (for use as function parameters).
func (Command) ReplyAssign ¶
ReplyAssign assigns the parameters of the reply. Not used.
func (Command) ReplySignature ¶
ReplySignature returns the reply signature. Not used.
type Domain ¶
type Domain struct { Domain string `json:"domain,omitempty"` Experimental bool `json:"experimental,omitempty"` Description string `json:"description,omitempty"` Dependencies []string `json:"dependencies,omitempty"` Types []AnyType `json:"types,omitempty"` Commands []Command `json:"commands,omitempty"` Events []Event `json:"events,omitempty"` Deprecated bool `json:"deprecated,omitempty"` }
Domain represents a domain, e.g. Page, Network, etc.
type Event ¶
type Event struct { NameName string `json:"name,omitempty"` Description string `json:"description,omitempty"` Parameters []AnyType `json:"parameters,omitempty"` Experimental bool `json:"experimental,omitempty"` Deprecated bool `json:"deprecated,omitempty"` }
Event represents an subscribeable event.