Skip to content

Commit f8e9fde

Browse files
authored
[chore] add README to checkapi (#38996)
Follow up to #38847 - adding a README for checkapi tool.
1 parent 3961da8 commit f8e9fde

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

cmd/checkapi/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
```

0 commit comments

Comments
 (0)