checkapi

command module
v0.123.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

README

CheckAPI

NOTE: CheckAPI is in development and immature. It is used primarily for opentelemetry-collector-contrib. Contributions are welcome.

CheckAPI is a go tool that parses the AST tree of a Go module, identifying Golang APIs such as structs and functions and enforcing rules against them.

This is particularly useful to reduce the API surface of a Go module to a specific set of functions.

Running CheckAPI

$> checkapi -folder . -config config.yaml

Configuration

The configuration file is in yaml format:

ignored_paths:
  - <exact relative paths of Golang modules to ignore>
allowed_functions:
  - <at least one function match must be present.>
  - name: <name of function>
    parameters: <list of parameters by type>
    return_types: <list of return types>

ignored_functions:
  - <regular expressions of ignored functions. At least one match must be present to ignore the function.>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL