-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathdocs.proto
More file actions
168 lines (150 loc) · 6 KB
/
docs.proto
File metadata and controls
168 lines (150 loc) · 6 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*
* Copyright 2018- The Pixie Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
syntax = "proto3";
package px.carnot.docspb;
option go_package = "docspb";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "src/carnot/udfspb/udfs.proto";
message IdentDoc {
// The name of the identifier.
string ident = 1;
// The description of the identifier.
string desc = 2;
// Expected type(s) of the identifier.
repeated string types = 3;
// The default value of the argument, if it exists.
string default = 4;
}
message FuncDoc {
// The arguments of the function.
repeated IdentDoc args = 1;
// The variable args field (*args) if the function supports it.
// *args will catch all unnamed arguments that aren't explicitly state. Ie
// `def func(*args)` can be called as `func(val1, val2)`
IdentDoc repeated_args = 2;
// The variable keyword args field (**kwargs) if the function supports it.
// **kwargs will catch all named arguments that aren't explicitly stated. Ie
// `def func(**kwargs)` can be called as `func(kwarg1=val1, kwarg2=val2)`
IdentDoc kwargs = 3;
// The value returned by the function, if there is one.
IdentDoc return_type = 4;
}
// DocstringNode is a structure containing a docstring for an object and
// pointers to children of the object stored as DocstringNodes. Children
// relationships include classes defined in a module (ie DataFrame in px)
// or methods of a class (ie agg() in class DataFrame()). DocstringNodes need to
// be parsed and formatted into a structured form that is friendly for the UI.
message DocstringNode {
// The name of the object.
string name = 1;
// Docstring of the object. Written according to the Google styleguide format
// for python. For more details:
// https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings
string docstring = 2;
// The children of the object, such as methods of a class or classes in a
// module. For example, children of `px` include the `DataFrame` class and the
// `display` function.
repeated DocstringNode children = 3;
}
// InternalPXLDocs contains all the documentation written in Carnot. The
// documentation comes "as-is" and has to be structured to use in the UI.
message InternalPXLDocs {
// The raw nodes containing top-level objects in the QL, their docstrings, and
// the docstrings of their descendents.
repeated DocstringNode docstring_nodes = 1;
// The documentation of all UDFs.
px.carnot.udfspb.Docs udf_docs = 2;
}
// Represents a single example.
message ExampleDoc {
// Example written as a string.
string value = 1;
}
// Description that contains all the info of an object.
message DocBody {
// The name of the documented obejct.
string name = 1;
// The short, single line description.
string brief = 2;
// The long form the description if it exists.
string desc = 3;
// The examples of how to use the documented object.
repeated ExampleDoc examples = 4;
}
// MutationDoc hold information about functions that change the state within
// Vizier. ie UpsertTracepoint()
message MutationDoc {
// The description of the mutation function.
DocBody body = 1;
// The documentation of the function.
FuncDoc func_doc = 2;
}
// Documentation for the decorators that define a tracepoint. ie goprobe()
message TracepointDecoratorDoc {
// The description of the documented tracepoint decorator.
DocBody body = 1;
// The documentation of the function.
FuncDoc func_doc = 2;
}
// TracepointFieldDoc contains information about the functions that encode
// properties of the tracepoint. Ie ArgExpr(), RetExpr(), FunctionLatency()
message TracepointFieldDoc {
// The description of the documented tracepoint spec doc.
DocBody body = 1;
// The documentation of the function to call for this field.
FuncDoc func_doc = 2;
}
// DataFrameOpDoc contains information about the Operators in the system.
message DataFrameOpDoc {
// The description of the documented tracepoint spec doc.
DocBody body = 1;
// The documentation of the function to call for this field.
FuncDoc func_doc = 2;
}
// CompileFnDoc contains information about functions that run at compile time.
message CompileFnDoc {
// The description of the documented compile time function.
DocBody body = 1;
// The documentation of the function to call for this field.
FuncDoc func_doc = 2;
}
// OTelDoc holds info about the OpenTelemetry exporter integraiotn.
message OTelDoc {
// The description of the documented OTel function.
DocBody body = 1;
// The documentation of the function to call for this field.
FuncDoc func_doc = 2;
}
// StructuredDocs is structured documentation that is ready to be parsed into
// the UI. This shouldn't require much work outside of formatting.
message StructuredDocs {
// Docs that store any operations that change Vizier state.
repeated MutationDoc mutation_docs = 1;
// Docs that store information about tracepoint decorators.
repeated TracepointDecoratorDoc tracepoint_decorator_docs = 2;
// Docs that store information about tracepoint fields.
repeated TracepointFieldDoc tracepoint_field_docs = 3;
// Docs that store information about DataFrame operators.
repeated DataFrameOpDoc dataframe_op_docs = 5;
// Docs that store information about compile time functions.
repeated CompileFnDoc compile_fn_docs = 6;
// Information about udf docs.
px.carnot.udfspb.Docs udf_docs = 4;
// Docs for the OpenTelemetry exporter.
repeated OTelDoc otel_docs = 7 [ (gogoproto.customname) = "OTelDocs" ];
}