GoPLS Viewer

Home|gopls/internal/event/export/ocagent/wire/common.go
1// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package wire
6
7// This file holds common ocagent types
8
9type Node struct {
10    Identifier  *ProcessIdentifier `json:"identifier,omitempty"`
11    LibraryInfo *LibraryInfo       `json:"library_info,omitempty"`
12    ServiceInfo *ServiceInfo       `json:"service_info,omitempty"`
13    Attributes  map[string]string  `json:"attributes,omitempty"`
14}
15
16type Resource struct {
17    Type   string            `json:"type,omitempty"`
18    Labels map[string]string `json:"labels,omitempty"`
19}
20
21type TruncatableString struct {
22    Value              string `json:"value,omitempty"`
23    TruncatedByteCount int32  `json:"truncated_byte_count,omitempty"`
24}
25
26type Attributes struct {
27    AttributeMap           map[string]Attribute `json:"attributeMap,omitempty"`
28    DroppedAttributesCount int32                `json:"dropped_attributes_count,omitempty"`
29}
30
31type StringAttribute struct {
32    StringValue *TruncatableString `json:"stringValue,omitempty"`
33}
34
35type IntAttribute struct {
36    IntValue int64 `json:"intValue,omitempty"`
37}
38
39type BoolAttribute struct {
40    BoolValue bool `json:"boolValue,omitempty"`
41}
42
43type DoubleAttribute struct {
44    DoubleValue float64 `json:"doubleValue,omitempty"`
45}
46
47type Attribute interface {
48    labelAttribute()
49}
50
51func (StringAttributelabelAttribute() {}
52func (IntAttributelabelAttribute()    {}
53func (BoolAttributelabelAttribute()   {}
54func (DoubleAttributelabelAttribute() {}
55
56type StackTrace struct {
57    StackFrames      *StackFrames `json:"stack_frames,omitempty"`
58    StackTraceHashID uint64       `json:"stack_trace_hash_id,omitempty"`
59}
60
61type StackFrames struct {
62    Frame              []*StackFrame `json:"frame,omitempty"`
63    DroppedFramesCount int32         `json:"dropped_frames_count,omitempty"`
64}
65
66type StackFrame struct {
67    FunctionName         *TruncatableString `json:"function_name,omitempty"`
68    OriginalFunctionName *TruncatableString `json:"original_function_name,omitempty"`
69    FileName             *TruncatableString `json:"file_name,omitempty"`
70    LineNumber           int64              `json:"line_number,omitempty"`
71    ColumnNumber         int64              `json:"column_number,omitempty"`
72    LoadModule           *Module            `json:"load_module,omitempty"`
73    SourceVersion        *TruncatableString `json:"source_version,omitempty"`
74}
75
76type Module struct {
77    Module  *TruncatableString `json:"module,omitempty"`
78    BuildID *TruncatableString `json:"build_id,omitempty"`
79}
80
81type ProcessIdentifier struct {
82    HostName       string    `json:"host_name,omitempty"`
83    Pid            uint32    `json:"pid,omitempty"`
84    StartTimestamp Timestamp `json:"start_timestamp,omitempty"`
85}
86
87type LibraryInfo struct {
88    Language           Language `json:"language,omitempty"`
89    ExporterVersion    string   `json:"exporter_version,omitempty"`
90    CoreLibraryVersion string   `json:"core_library_version,omitempty"`
91}
92
93type Language int32
94
95const (
96    LanguageGo Language = 4
97)
98
99type ServiceInfo struct {
100    Name string `json:"name,omitempty"`
101}
102
MembersX
Node.Attributes
Attributes.DroppedAttributesCount
Attribute
StringAttribute.labelAttribute
ProcessIdentifier
ProcessIdentifier.HostName
Node.ServiceInfo
StackFrames
StackFrames.Frame
StackFrame.FunctionName
LibraryInfo
Resource.Labels
BoolAttribute.labelAttribute
StackFrames.DroppedFramesCount
StackFrame.ColumnNumber
Module.BuildID
TruncatableString
StackTrace.StackTraceHashID
StackFrame.FileName
StringAttribute.StringValue
LibraryInfo.CoreLibraryVersion
IntAttribute.IntValue
StackFrame.LoadModule
StackFrame
StackFrame.OriginalFunctionName
LanguageGo
ServiceInfo
Resource
Resource.Type
IntAttribute.labelAttribute
DoubleAttribute.labelAttribute
BoolAttribute.BoolValue
Module.Module
ProcessIdentifier.Pid
Language
Attributes
LibraryInfo.Language
ServiceInfo.Name
Node
Attributes.AttributeMap
IntAttribute
DoubleAttribute.DoubleValue
StackFrame.LineNumber
LibraryInfo.ExporterVersion
BoolAttribute
StackTrace.StackFrames
StackFrame.SourceVersion
TruncatableString.Value
StackTrace
Module
Node.LibraryInfo
StringAttribute
DoubleAttribute
ProcessIdentifier.StartTimestamp
Node.Identifier
TruncatableString.TruncatedByteCount
Members
X