Documentation ¶
Overview ¶
Package pdl contains types and funcs for working with Chrome DevTools Protocol definitions (ie, PDL files).
Index ¶
Constants ¶
const HAR = `` /* 11459-byte string literal not displayed */
HAR is the PDL formatted definition of HTTP Archive (HAR) types.
Variables ¶
This section is empty.
Functions ¶
func CombineBytes ¶
CombineBytes combines domains from multiple PDL definitions into a single PDL.
func IsCircularDep ¶
IsCircularDep returns whether or not a type will cause circular dependency issues. Useful for generating Go packages.
Types ¶
type Domain ¶
type Domain struct { // Domain is the name of the domain. Domain DomainType // Description is the domain description. Description string // Experimental indicates whether or not the domain is experimental. Experimental bool // Deprecated indicates whether or not the domain is deprecated. Deprecated bool // Dependencies are the domains' dependencies. Dependencies []string // Types are the list of types in the domain. Types []*Type // Commands are the list of commands in the domain. Commands []*Type // Events is the list of events types in the domain. Events []*Type }
Domain represents a Chrome DevTools Protocol domain.
type PDL ¶
type PDL struct { // Copyright is the file copyright. Copyright string // Version is the file version information. Version *Version // Domains are the available domains. Domains []*Domain }
PDL contains information about the domains, types, commands, and events of the Chrome DevTools Protocol.
type Redirect ¶
type Redirect struct { // Domain is the domain to redirect to. Domain DomainType // Name is the name of the command, event, or type to redirect to. Name string }
Redirect holds type redirect information.
type TimestampType ¶
type TimestampType int
TimestampType are the various timestamp subtypes.
const ( TimestampTypeMillisecond TimestampType = 1 + iota TimestampTypeSecond TimestampTypeMonotonic )
TimestampType values.
type Type ¶
type Type struct { // Type is the base type of the type. Type TypeEnum // Name is the name of the type. Name string // Description is the type description. Description string // Experimental indicates whether or not the type is experimental. Experimental bool // Deprecated indicates if the type is deprecated. Used for commands and event parameters. Deprecated bool // Optional indicates whether or not the type is optional. Optional bool // Ref is the type the object refers to. Ref string // Items is the contained type for arrays. Items *Type // Parameters are object parameters for commands or events. Parameters []*Type // Returns are the return values for commands. Returns []*Type // Properties are object properties. Properties []*Type // Redirect is a type to redirect to, if any. Redirect *Redirect // Enum are string enum values. Enum []string // RawType is the raw type. RawType string `json:"-"` // RawName is the raw type name. RawName string `json:"-"` // RawSee is a raw see url reference. RawSee string `json:"-"` // TimestampType is the timestamp subtype. TimestampType TimestampType `json:"-"` // IsCircularDep indicates a type that causes circular dependencies. IsCircularDep bool `json:"-"` // NoExpose toggles whether or not to expose the type. NoExpose bool `json:"-"` // NoResolve toggles not resolving the type to a domain (ie, for special // internal types). NoResolve bool `json:"-"` // AlwaysEmit forces the value to always be emitted when marshaled to JSON. AlwaysEmit bool `json:"-"` // EnumValueNameMap is a map to override the generated enum value name. EnumValueNameMap map[string]string `json:"-"` // EnumBitMask toggles it as a bit mask enum for TypeInteger enums. EnumBitMask bool `json:"-"` // Extra will be added as output after the the type is emitted. Extra string `json:"-"` }
Type represents a Chrome DevTools Protocol type.
type TypeEnum ¶
type TypeEnum string
TypeEnum is the Chrome domain type enum.
const ( TypeAny TypeEnum = "any" TypeArray TypeEnum = "array" TypeBinary TypeEnum = "binary" TypeBoolean TypeEnum = "boolean" TypeInteger TypeEnum = "integer" TypeNumber TypeEnum = "number" TypeObject TypeEnum = "object" TypeString TypeEnum = "string" TypeTimestamp TypeEnum = "timestamp" )
TypeEnum values.