parsing

package
v5.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileUnreadable = errors.New("file unreadable")
	ErrMalformedYAML  = errors.New("malformed YAML")

	ErrNotASpecReference                   = errors.New("not a SPEC/ reference")
	ErrHasQualifier                        = errors.New("logical name has qualifier")
	ErrUnexpectedContentBeforeFirstHeading = errors.New("unexpected content before first heading")
	ErrNodeNameDoesNotMatch                = errors.New("node name does not match")
	ErrDuplicatePublicSection              = errors.New("duplicate # Public section")
	ErrDuplicateAgentSection               = errors.New("duplicate # Agent section")
	ErrDuplicatePrivateSection             = errors.New("duplicate # Private section")
	ErrUnrecognizedSection                 = errors.New("unrecognized section")
	ErrDuplicateSubsection                 = errors.New("duplicate subsection")

	ErrUnrecognizedPrefix = errors.New("unrecognized prefix")
	ErrInvalidName        = errors.New("invalid name")
	ErrNoOutput           = errors.New("no output declared")
	ErrInvalidPath        = errors.New("invalid path")
)

Functions

func ConcatenateSubsections

func ConcatenateSubsections(subsections []*NodeSubsection) string

func ExtractAgentContent

func ExtractAgentContent(node *Node) string

func ExtractBlock

func ExtractBlock(content []string) string

func FormatSection

func FormatSection(rawHeading string, content []string) string

func NormalizeText

func NormalizeText(rawString string) string

func ReadFileContent

func ReadFileContent(cfsPath oslayer.CfsPath) (string, error)

Types

type CfsNodeType

type CfsNodeType int
const (
	CfsNodeTypeSpec     CfsNodeType = iota
	CfsNodeTypeArtifact CfsNodeType = iota
	CfsNodeTypeExternal CfsNodeType = iota
)

type CfsReference

type CfsReference struct {
	NodeType    CfsNodeType
	LogicalName string
	Qualifier   *string
	Path        string
	ParentName  *string
}

func CfsReferenceFromName

func CfsReferenceFromName(logicalName string) (*CfsReference, error)

func CfsReferenceFromPath

func CfsReferenceFromPath(cfsPath oslayer.CfsPath) (*CfsReference, error)

type Node

type Node struct {
	Reference   CfsReference
	Frontmatter *NodeFrontmatter
	NameSection NodeSection
	Public      *NodeSection
	Agent       *NodeSection
	Private     *NodeSection
}

func ParseNode

func ParseNode(logicalName string) (*Node, error)

type NodeFrontmatter

type NodeFrontmatter struct {
	DependsOn []string
	Input     *string
	Output    *string
}

type NodeSection

type NodeSection struct {
	Heading     string
	RawHeading  string
	Content     []string
	Subsections []*NodeSubsection
}

type NodeSubsection

type NodeSubsection struct {
	Heading    string
	RawHeading string
	Content    []string
}

Jump to

Keyboard shortcuts

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