checkapi

command module
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

README

CheckAPI

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.>
unkeyed_literal_initialization:
  enabled: <bool>
  limit: <number of fields under which we should prevent unkeyed literal initialization> 

Documentation

Overview

Checkapi is a tool to check the API of OpenTelemetry Go modules.

Directories

Path Synopsis
Package internal provides internal utilities for the checkapi package.
Package internal provides internal utilities for the checkapi package.

Jump to

Keyboard shortcuts

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