Documentation
¶
Overview ¶
Package spec reads specification sources and pins their addressable units.
Index ¶
- Constants
- func ConfigureSources(sources []Source) error
- func FollowDiff(pinned, current Sequence) string
- func InOpenSpecChanges(path string) bool
- func PinnedFeatures(ctx context.Context, root string, source Source, commit string, ...) (map[string]*FeatureBlock, error)
- func ReadFile(root, path string) (Document, []Finding)
- func Reference(ref string, scenario bool) (source, file, address string, ok bool)
- func RefreshCache(ctx context.Context, root string, sources []Source)
- func SequenceDiff(pinned, record Sequence) string
- type Adapter
- type BindingStrength
- type Change
- type DocString
- type Document
- type FeatureBlock
- type Finding
- type Format
- type Lock
- type LockedFile
- type LockedScenario
- type LockedSource
- type Sequence
- type Source
- type Step
- type Unit
Constants ¶
const ( SpecMoved = "spec-moved" Orphaned = "orphaned" Unclaimed = "unclaimed" Unmeasured = "unmeasured" Deprecated = "deprecated" ChangedSpecAdvice = "" /* 134-byte string literal not displayed */ )
const LockName = "docs/facets/spec-lock.yaml"
Variables ¶
This section is empty.
Functions ¶
func ConfigureSources ¶
func FollowDiff ¶
FollowDiff shows changes to the normalised scenario sequence at follow.
func InOpenSpecChanges ¶
func PinnedFeatures ¶
func PinnedFeatures(ctx context.Context, root string, source Source, commit string, pins map[string]LockedScenario) (map[string]*FeatureBlock, error)
PinnedFeatures reads blocks containing the requested pins at one commit.
func RefreshCache ¶
RefreshCache fetches the configured branches without reading or changing the lock.
func SequenceDiff ¶
SequenceDiff shows the changed portion of the pinned and record sequences.
Types ¶
type Adapter ¶
type Adapter interface {
Read(root, path string, data []byte) (Document, []Finding)
Matches(relativePath string) bool
}
Adapter reads one file within a source and returns its addressable units.
func AdapterFor ¶
type BindingStrength ¶
type BindingStrength string
const ( Exact BindingStrength = "exact" Provenance BindingStrength = "provenance" UnknownBinding BindingStrength = "unknown" )
type Change ¶
type Change struct {
Source string
Address string
Kind string
Binding BindingStrength
}
type FeatureBlock ¶
type Finding ¶
type Finding struct {
File string `json:"file"`
Line int `json:"line"`
Message string `json:"message"`
Binding BindingStrength `json:"binding"`
}
type Format ¶
type Format string
func (Format) Strength ¶
func (f Format) Strength() BindingStrength
type Lock ¶
type Lock map[string]LockedSource
type LockedFile ¶
type LockedScenario ¶
type LockedScenario struct {
Commit string `yaml:"commit"`
Binding BindingStrength `yaml:"binding,omitempty"`
Steps string `yaml:"steps"`
Context string `yaml:"context,omitempty"`
Sequence *Sequence `yaml:"sequence,omitempty"`
Text string `yaml:"text,omitempty"`
}
func (LockedScenario) FollowDiff ¶
func (s LockedScenario) FollowDiff(current LockedScenario) string
func (LockedScenario) Strength ¶
func (s LockedScenario) Strength() BindingStrength
type LockedSource ¶
type LockedSource struct {
Repo string `yaml:"repo"`
Follow string `yaml:"follow"`
Format Format `yaml:"format"`
Commit string `yaml:"commit,omitempty"`
Files map[string]LockedFile `yaml:"files"`
Scenarios map[string]LockedScenario `yaml:"scenarios"`
}
func ReadFollow ¶
ReadFollow reads the committed specification files at the fetched branch tip.
type Sequence ¶
type Sequence struct {
Steps []Step `json:"steps" yaml:"steps"`
Examples [][][]string `json:"examples,omitempty" yaml:"examples,omitempty,flow"`
}
func NormaliseStatement ¶
NormaliseStatement parses one record statement in the given dialect (English when empty). A statement consists of steps and their arguments.