Documentation
¶
Overview ¶
Package policy is the catalog of standards documents and the dated milestones the product acts on (ADR-0022). It is data, embedded from catalog.json and validated when it loads: a document has a status, a date, an address and the place it was transcribed from, and nothing that deprecates, disallows or requires anything rests on a draft.
The checks that judge a scan against a standard's clauses stay code in internal/eval; this package holds only facts about documents.
Index ¶
Constants ¶
const ( StatusFinal = "final" StatusDraft = "draft" StatusWithdrawn = "withdrawn" StatusSuperseded = "superseded" )
Document statuses.
const ( EffectDeprecated = "deprecated" EffectDisallowed = "disallowed" EffectRequired = "required" EffectRecommended = "recommended" )
Milestone effects.
const ( RelationAfter = "after" RelationBy = "by" )
Milestone relations to their date: "after" the end of the day, or "by" the end of the day.
const ( ScopeGeneral = "general" ScopeUSFederal = "us-federal" ScopeUSFederalHVA = "us-federal-hva" )
Scopes say whom a milestone binds.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Catalog ¶
type Catalog struct {
Version string `json:"version"`
About string `json:"about"`
Documents []Document `json:"documents"`
Milestones []Milestone `json:"milestones"`
Profiles []Profile `json:"profiles"`
}
Catalog is the whole catalog.
func Default ¶
func Default() *Catalog
Default is the embedded catalog. It panics if the embedded file is invalid, which a test rules out.
func (*Catalog) MustMilestone ¶
MustMilestone returns the milestone with this id or panics: for the evaluation's fixed references, which a test checks resolve.
type Document ¶
type Document struct {
ID string `json:"id"`
Publisher string `json:"publisher"`
Identifier string `json:"identifier"`
Title string `json:"title"`
Status string `json:"status"`
// Published is the publication date as YYYY-MM-DD, YYYY-MM, or empty when not recorded.
Published string `json:"published"`
URL string `json:"url"`
Families []string `json:"families"`
Notes string `json:"notes,omitempty"`
Provenance string `json:"provenance"`
}
Document is one published (or draft) standard or guidance document.
type Milestone ¶
type Milestone struct {
ID string `json:"id"`
Document string `json:"document"`
Clause string `json:"clause"`
Text string `json:"text"`
Effect string `json:"effect"`
Relation string `json:"relation"`
Date string `json:"date"`
Families []string `json:"families"`
StrengthBits int `json:"strengthBits,omitempty"`
Scope string `json:"scope"`
Provenance string `json:"provenance"`
}
Milestone is one dated statement of a document.