/
types.go
122 lines (106 loc) · 4.97 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Code generated by cdpgen. DO NOT EDIT.
package debugger
import (
"github.com/mafredri/cdp/protocol/runtime"
)
// BreakpointID Breakpoint identifier.
type BreakpointID string
// CallFrameID Call frame identifier.
type CallFrameID string
// Location Location in the source code.
type Location struct {
ScriptID runtime.ScriptID `json:"scriptId"` // Script identifier as reported in the `Debugger.scriptParsed`.
LineNumber int `json:"lineNumber"` // Line number in the script (0-based).
ColumnNumber *int `json:"columnNumber,omitempty"` // Column number in the script (0-based).
}
// ScriptPosition Location in the source code.
//
// Note: This type is experimental.
type ScriptPosition struct {
LineNumber int `json:"lineNumber"` // No description.
ColumnNumber int `json:"columnNumber"` // No description.
}
// LocationRange Location range within one script.
//
// Note: This type is experimental.
type LocationRange struct {
ScriptID runtime.ScriptID `json:"scriptId"` // No description.
Start ScriptPosition `json:"start"` // No description.
End ScriptPosition `json:"end"` // No description.
}
// CallFrame JavaScript call frame. Array of call frames form the call stack.
type CallFrame struct {
CallFrameID CallFrameID `json:"callFrameId"` // Call frame identifier. This identifier is only valid while the virtual machine is paused.
FunctionName string `json:"functionName"` // Name of the JavaScript function called on this call frame.
FunctionLocation *Location `json:"functionLocation,omitempty"` // Location in the source code.
Location Location `json:"location"` // Location in the source code.
// URL is deprecated.
//
// Deprecated: JavaScript script name or url. Deprecated in favor of
// using the `location.scriptId` to resolve the URL via a previously
// sent `Debugger.scriptParsed` event.
URL string `json:"url"`
ScopeChain []Scope `json:"scopeChain"` // Scope chain for this call frame.
This runtime.RemoteObject `json:"this"` // `this` object for this call frame.
ReturnValue *runtime.RemoteObject `json:"returnValue,omitempty"` // The value being returned, if the function is at return point.
// CanBeRestarted Valid only while the VM is paused and indicates
// whether this frame can be restarted or not. Note that a `true` value
// here does not guarantee that Debugger#restartFrame with this
// CallFrameId will be successful, but it is very likely.
//
// Note: This property is experimental.
CanBeRestarted *bool `json:"canBeRestarted,omitempty"`
}
// Scope Scope description.
type Scope struct {
// Type Scope type.
//
// Values: "global", "local", "with", "closure", "catch", "block", "script", "eval", "module", "wasm-expression-stack".
Type string `json:"type"`
Object runtime.RemoteObject `json:"object"` // Object representing the scope. For `global` and `with` scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
Name *string `json:"name,omitempty"` // No description.
StartLocation *Location `json:"startLocation,omitempty"` // Location in the source code where scope starts
EndLocation *Location `json:"endLocation,omitempty"` // Location in the source code where scope ends
}
// SearchMatch Search match for resource.
type SearchMatch struct {
LineNumber float64 `json:"lineNumber"` // Line number in resource content.
LineContent string `json:"lineContent"` // Line with match content.
}
// BreakLocation
type BreakLocation struct {
ScriptID runtime.ScriptID `json:"scriptId"` // Script identifier as reported in the `Debugger.scriptParsed`.
LineNumber int `json:"lineNumber"` // Line number in the script (0-based).
ColumnNumber *int `json:"columnNumber,omitempty"` // Column number in the script (0-based).
// Type
//
// Values: "debuggerStatement", "call", "return".
Type *string `json:"type,omitempty"`
}
// ScriptLanguage Enum of possible script languages.
type ScriptLanguage string
// ScriptLanguage as enums.
const (
ScriptLanguageNotSet ScriptLanguage = ""
ScriptLanguageJavaScript ScriptLanguage = "JavaScript"
ScriptLanguageWebAssembly ScriptLanguage = "WebAssembly"
)
func (e ScriptLanguage) Valid() bool {
switch e {
case "JavaScript", "WebAssembly":
return true
default:
return false
}
}
func (e ScriptLanguage) String() string {
return string(e)
}
// DebugSymbols Debug symbols available for a wasm script.
type DebugSymbols struct {
// Type Type of the debug symbols.
//
// Values: "None", "SourceMap", "EmbeddedDWARF", "ExternalDWARF".
Type string `json:"type"`
ExternalURL *string `json:"externalURL,omitempty"` // URL of the external symbol source.
}