File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ # CheckAPI
2
+
3
+ ** NOTE: CheckAPI is in development and immature. It is used primarily for opentelemetry-collector-contrib. Contributions are welcome.**
4
+
5
+ CheckAPI is a go tool that parses the AST tree of a Go module, identifying Golang APIs such as structs and functions
6
+ and enforcing rules against them.
7
+
8
+ This is particularly useful to reduce the API surface of a Go module to a specific set of functions.
9
+
10
+ ## Running CheckAPI
11
+
12
+ ``` shell
13
+ $> checkapi -folder . -config config.yaml
14
+ ```
15
+
16
+ ## Configuration
17
+
18
+ The configuration file is in yaml format:
19
+
20
+ ``` yaml
21
+ ignored_paths :
22
+ - <exact relative paths of Golang modules to ignore>
23
+ allowed_functions :
24
+ - <at least one function match must be present.>
25
+ - name : <name of function>
26
+ parameters : <list of parameters by type>
27
+ return_types : <list of return types>
28
+
29
+ ignored_functions :
30
+ - <regular expressions of ignored functions. At least one match must be present to ignore the function.>
31
+ ` ` `
You can’t perform that action at this time.
0 commit comments