Documentation
¶
Overview ¶
Package contracts owns strict, versioned project semantic contracts.
Index ¶
Constants ¶
const ( // Version is the only accepted semantic-contract schema version. Version = 1 // MaxFiles bounds one project contract snapshot. MaxFiles = 32 // MaxFunctions bounds declarations across one project contract snapshot. MaxFunctions = 4096 // MaxIndices bounds one indexed effect list. MaxIndices = 64 // MaxFileBytes bounds one contract file before decoding. MaxFileBytes = 1 << 20 // MaxTotalBytes bounds all contract files before decoding. MaxTotalBytes = 4 << 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
Path string
Line int
Column int
Message string
// contains filtered or unexported fields
}
Error is one contract-file diagnostic.
type Function ¶
type Function struct {
Symbol string
NoReturn bool
MustUse []int
Closes []int
TakesOwnership []int
CompletesTransaction []int
InvokesCancellation []int
Blocking bool
NilError []NilErrorRelation
ReturnsAlias []ReturnAlias
Source Source
}
Function describes configured semantics for one exact function or method.
type NilErrorRelation ¶
NilErrorRelation describes a result state conditional on an error result.
type Resolved ¶
type Resolved struct {
// contains filtered or unexported fields
}
Resolved is an immutable lookup keyed by stable package-qualified identity.
func Resolve ¶
Resolve binds declarations to exact functions available in a loaded type graph. Declarations for packages absent from the graph remain deferred. A declaration whose package is present but whose function or method is absent is invalid.
type ReturnAlias ¶
ReturnAlias states that one result aliases one argument.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is one immutable, canonical collection of project contracts.
func ParseFiles ¶
ParseFiles strictly decodes and canonicalizes one complete contract snapshot.
func (Set) CanonicalBytes ¶
CanonicalBytes returns a declaration-order and file-order independent identity.