Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastColumnOnLine ¶
GetLastColumnOnLine returns the last column on a given line based on the provided line positions. The second return value is the raw offset for the end of the line.
func PositionFromSourceMeta ¶
PositionFromSourceMeta returns the line and column from the provided source meta. This is primarily useful for attaching position information to errors.
Types ¶
type Meta ¶
Meta represents information about the deserialised source of a blueprint value including the line and column where a blueprint element begins that can be used by tools such as linters to provide more detailed diagnostics to users creating blueprints from source in some supported formats.
func ExtractSourcePositionForJSONNodeMapField ¶
ExtractSourcePositionForJSONNodeMapField extracts the position in source document from a given JSON node and line positions.
type Position ¶
Position represents a position in the source code of a blueprint.
func EndSourcePositionFromYAMLScalarNode ¶
EndSourcePositionFromYAMLScalarNode returns the precise end position of a YAML scalar node.
func PositionFromJSONNode ¶
PositionFromJSONNode returns the position of a JSON node in the source code based on the node and an ordered list of line offsets.
func PositionFromOffset ¶
PositionFromOffset returns the position of a character in the source code based on the offset and an ordered list of line offsets. This treats the offset of a new line character as the end of the line and not the first column of the next line.
type PositionInfo ¶
PositionInfo provides an interface for the position information of a value. This is primarily useful for attaching position information to errors for values extracted from intermediary source document nodes with position/offset information.