Documentation
¶
Overview ¶
Package validation evaluates closed structural predicates against a trusted persisted Gograph snapshot. It is transport-neutral and never rebuilds a graph.
Index ¶
- Constants
- type Analysis
- type Binding
- type Diagnostic
- type Evaluation
- type Evaluator
- type Evidence
- type Location
- type MatchedRelation
- type Outcome
- type Precision
- type Predicate
- type Reason
- type Reference
- type ReferenceKind
- type Repository
- type RepositoryLoader
- type Request
- type RequestRecord
- type ResolvedReference
- type Result
- type Snapshot
- type SnapshotError
- type SnapshotLoader
- type VersionDocument
Constants ¶
View Source
const ( BindingSchemaVersion = "gograph.binding.v1" ResultSchemaVersion = "gograph.validation.v1" VersionSchemaVersion = "gograph.version.v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analysis ¶
type Analysis struct {
GraphSchemaVersion string `json:"graph_schema_version,omitempty"`
SourcePolicyVersion int `json:"source_policy_version,omitempty"`
GraphFingerprint string `json:"graph_fingerprint,omitempty"`
BuildContextFingerprint string `json:"build_context_fingerprint,omitempty"`
Mode string `json:"mode,omitempty"`
Precision Precision `json:"precision,omitempty"`
Completeness string `json:"completeness,omitempty"`
Freshness string `json:"freshness,omitempty"`
GraphGeneratedAt *time.Time `json:"graph_generated_at,omitempty"`
}
type Binding ¶
type Diagnostic ¶
type Evaluation ¶
type Evaluation struct {
Outcome Outcome `json:"outcome"`
Reason Reason `json:"reason"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
func NewEvaluator ¶
func NewEvaluatorWithLoader ¶
func NewEvaluatorWithLoader(version string, loader SnapshotLoader) *Evaluator
type Evidence ¶
type Evidence struct {
ResolvedSubject *ResolvedReference `json:"resolved_subject,omitempty"`
ResolvedObject *ResolvedReference `json:"resolved_object,omitempty"`
MatchedRelations []MatchedRelation `json:"matched_relations"`
}
type MatchedRelation ¶
type Reason ¶
type Reason string
const ( ReasonPredicatePassed Reason = "predicate_passed" ReasonPredicateFailed Reason = "predicate_failed" ReasonSymbolNotFound Reason = "symbol_not_found" ReasonSymbolAmbiguous Reason = "symbol_ambiguous" ReasonPackageNotFound Reason = "package_not_found" ReasonRelationNotFound Reason = "relation_not_found" ReasonGraphMissing Reason = "graph_missing" ReasonGraphInvalid Reason = "graph_invalid" ReasonGraphSchemaUnsupported Reason = "graph_schema_unsupported" ReasonSourcePolicyUnsupported Reason = "source_policy_unsupported" ReasonGraphStale Reason = "graph_stale" ReasonPrecisionInsufficient Reason = "precision_insufficient" ReasonAnalysisIncomplete Reason = "analysis_incomplete" ReasonSymbolIdentityUnstable Reason = "symbol_identity_unstable" ReasonUnsupportedPredicate Reason = "unsupported_predicate" ReasonUnsupportedLanguage Reason = "unsupported_language" ReasonRepositoryMismatch Reason = "repository_mismatch" ReasonInvalidRequest Reason = "invalid_request" ReasonInternalError Reason = "internal_error" )
type Reference ¶
type Reference struct {
Language string `json:"language"`
Kind ReferenceKind `json:"kind"`
ID string `json:"id"`
}
type ReferenceKind ¶
type ReferenceKind string
const ( ReferenceSymbol ReferenceKind = "symbol" ReferencePackage ReferenceKind = "package" )
type Repository ¶
type RepositoryLoader ¶
type RepositoryLoader struct {
BuildTags []string
// AllowCheckoutSourceAuthority permits go.work members outside a nested
// module root when ToolchainSourceRoots has confined them beneath the
// nearest real Git checkout. Machine validation leaves this false so its
// explicit --repo path remains the complete toolchain authority.
AllowCheckoutSourceAuthority bool
}
func (RepositoryLoader) VerifyCurrent ¶
func (loader RepositoryLoader) VerifyCurrent(ctx context.Context, snapshot Snapshot) error
type RequestRecord ¶
type ResolvedReference ¶
type ResolvedReference struct {
Kind ReferenceKind `json:"kind"`
ID string `json:"id"`
SymbolKind string `json:"symbol_kind,omitempty"`
Locations []Location `json:"locations"`
}
type Result ¶
type Result struct {
SchemaVersion string `json:"schema_version"`
Command string `json:"command"`
GographVersion string `json:"gograph_version"`
GeneratedAt time.Time `json:"generated_at"`
Repository Repository `json:"repository"`
Analysis Analysis `json:"analysis"`
Request RequestRecord `json:"request"`
Evaluation Evaluation `json:"evaluation"`
Evidence Evidence `json:"evidence"`
}
func InvalidRequestResult ¶
type SnapshotError ¶
type SnapshotError struct {
Reason Reason
Diagnostic Diagnostic
}
func (*SnapshotError) Error ¶
func (e *SnapshotError) Error() string
type SnapshotLoader ¶
type VersionDocument ¶
Click to show internal directories.
Click to hide internal directories.