Documentation
¶
Overview ¶
Package seams enforces the provider seam rules of AGENTS.md.
Index ¶
- Variables
- func CheckGaps(seams []Seam, file, atBase map[string]string, haveBase bool) []string
- func CheckHosts(hits map[string]string, allow map[string]string) []string
- func CheckSDKImports(m *Module, impls map[string]bool, allow map[string]string) []string
- func CheckTable(m *Module, seams []Seam) []string
- func HostHits(m *Module) (map[string]string, error)
- func ImplDirs(seams []Seam) map[string]bool
- func ParseAllowlist(name string, data []byte) (map[string]string, error)
- type Module
- type Seam
Constants ¶
This section is empty.
Variables ¶
var Hosts = []string{"api.github.com", "ghcr.io", "github.com", "googleapis.com", "amazonaws.com", "r2.cloudflarestorage.com"}
Hosts are the provider host names that only allowlisted files may hold.
var SDKPrefixes = []string{
"cloud.google.com/",
"google.golang.org/api/",
"golang.org/x/oauth2/google",
"github.com/googleapis/",
"github.com/aws/",
"github.com/Azure/",
"github.com/google/go-github",
"github.com/xanzy/",
"github.com/shurcooL/githubv4",
"github.com/bradleyfalzon/ghinstallation",
"github.com/cloudflare/cloudflare-go",
"gitlab.com/gitlab-org/",
}
SDKPrefixes are the import path prefixes of cloud and forge provider SDKs.
Functions ¶
func CheckGaps ¶
CheckGaps compares the gap rows of the table with the gap file. When the file at the merge base is known, a gap that the base file does not hold also fails: the gap list only shrinks.
func CheckHosts ¶
CheckHosts reports a file that holds a provider host and matches no allow entry (a path or a glob), and an entry that matches no such file.
func CheckSDKImports ¶
CheckSDKImports reports a package that imports a provider SDK and is neither an implementation package of a seam, a package under cmd/, nor in allow. It also reports an allow entry that no package needs.
func CheckTable ¶
CheckTable reports each difference between the table and the code.
func HostHits ¶
HostHits returns each file that holds a provider host: a Go string literal (an import path and the module path excepted) or a line of a YAML file under .github or charts.
Types ¶
type Module ¶
type Module struct {
Path string
// contains filtered or unexported fields
}
Module is the parsed Go source of one module.
type Seam ¶
type Seam struct {
Name string
Iface string
Suite string
Impls []string
Gap string
// Contract is true for a row that documents a contract of the machine with no code interface. It is not a gap.
Contract bool
}
Seam is one row of the Provider seams table.
func ParseTable ¶
ParseTable reads the table under the heading "## Provider seams".