config

package
v0.0.0-...-f115076 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BannedAPI

type BannedAPI struct {
	Name       string      `json:"name"` // fully qualified identifier name
	Msg        string      `json:"msg"`  // additional information e.g. rationale for banning
	Exemptions []Exemption `json:"exemptions"`
}

BannedAPI represents an identifier (e.g. import, function call) that should not be used.

type Config

type Config struct {
	Imports   []BannedAPI `json:"imports"`
	Functions []BannedAPI `json:"functions"`
}

Config represents a configuration passed to the linter.

func ReadConfigs

func ReadConfigs(files []string) (*Config, error)

ReadConfigs reads banned APIs from all files.

type Exemption

type Exemption struct {
	Justification string `json:"justification"`
	AllowedPkg    string `json:"allowedPkg"` // Uses Go RegExp https://golang.org/pkg/regexp/syntax
}

Exemption represents a location that should be exempted from checking for banned APIs.

Jump to

Keyboard shortcuts

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