seams

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package seams enforces the provider seam rules of AGENTS.md.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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

func CheckGaps(seams []Seam, file, atBase map[string]string, haveBase bool) []string

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

func CheckHosts(hits map[string]string, allow map[string]string) []string

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

func CheckSDKImports(m *Module, impls map[string]bool, allow map[string]string) []string

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

func CheckTable(m *Module, seams []Seam) []string

CheckTable reports each difference between the table and the code.

func HostHits

func HostHits(m *Module) (map[string]string, error)

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.

func ImplDirs

func ImplDirs(seams []Seam) map[string]bool

ImplDirs returns the implementation packages of the table.

func ParseAllowlist

func ParseAllowlist(name string, data []byte) (map[string]string, error)

ParseAllowlist reads "key # reason" lines. A line with no reason is an error.

Types

type Module

type Module struct {
	Path string
	// contains filtered or unexported fields
}

Module is the parsed Go source of one module.

func Load

func Load(fsys fs.FS) (*Module, error)

Load parses every Go file of the module in fsys, skipping testdata and hidden directories.

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

func ParseTable(doc []byte) ([]Seam, error)

ParseTable reads the table under the heading "## Provider seams".

Jump to

Keyboard shortcuts

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