Documentation ¶
Overview ¶
Package navigadoc provides utility functions to the Naviga Doc format
Index ¶
- Variables
- func CheckForEmptyBlocks(document *doc.Document) error
- func CheckForEmptyBlocksRecursive(block doc.Block, kind string, idx int, path []string) error
- func DeDuplicateLinks(links []doc.Block, linksToDeDuplicate []doc.Block) []doc.Block
- func DeleteBlocks(document doc.Document, blocksToDelete []doc.Block) *doc.Document
- func FilterBlocks(blocks []doc.Block, filter func(a doc.Block) bool) []doc.Block
- func GetBlocks(document doc.Document, patterns []doc.Block) []doc.Block
- func GetBlocksToKeep(blocks []doc.Block, patterns []doc.Block) []doc.Block
- func MergeProperties(existingProperties []doc.Property, newProperties []doc.Property) []doc.Property
- func ReplaceBlocks(document doc.Document, blocksToReplace []BlockReplacement) *doc.Document
- func ValidateAndLowercaseDocumentUUIDs(block doc.Block, args ...interface{}) (doc.Block, error)deprecated
- func ValidateDocumentUUIDs(block doc.Block, args ...interface{}) (doc.Block, error)
- func ValidateNavigadocJSON(document string) ([]error, error)
- func ValidateUUID(theUUID string) error
- func WalkBlock(block doc.Block, args []interface{}, fns ...BlockVisitor) (doc.Block, error)
- func WalkBlocks(s []doc.Block, args []interface{}, fns ...BlockVisitor) error
- func WalkDocument(document *doc.Document, args []interface{}, fns ...BlockVisitor) error
- type BlockReplacement
- type BlockSorter
- type BlockVisitor
- type InvalidArgumentError
- type MalformedDocumentError
- type RequiredArgumentError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyBlock = &MalformedDocumentError{"empty block"} ErrEmptyDoc = &MalformedDocumentError{"empty document"} ErrEmptyConcept = &MalformedDocumentError{"empty concept"} ErrEmptyNewsItem = &MalformedDocumentError{"empty newsitem"} ErrEmptyAssignment = &MalformedDocumentError{"empty assignment"} ErrEmptyList = &MalformedDocumentError{"empty list"} ErrEmptyPlanningItem = &MalformedDocumentError{"empty planningitem"} ErrEmptyPackage = &MalformedDocumentError{"empty list package"} ErrUnsupportedType = &MalformedDocumentError{"unsuported type"} )
NavigaDocSchema embedded schemas
Functions ¶
func CheckForEmptyBlocks ¶
func DeDuplicateLinks ¶
func DeleteBlocks ¶
func FilterBlocks ¶
func GetBlocksToKeep ¶
returns block NOT matching the pattern
func MergeProperties ¶
func ReplaceBlocks ¶
func ReplaceBlocks(document doc.Document, blocksToReplace []BlockReplacement) *doc.Document
func ValidateAndLowercaseDocumentUUIDs
deprecated
func ValidateDocumentUUIDs ¶
ValidateDocumentUUIDs Walks each document block to validate and lowercase convert UUIDs
func ValidateNavigadocJSON ¶
ValidateNavigadocJSON validates the Navigadoc against a JSON Schema The error array contains schema issues A non-nil error indicates an error with the validator
func ValidateUUID ¶ added in v0.1.1
func WalkBlocks ¶
func WalkBlocks(s []doc.Block, args []interface{}, fns ...BlockVisitor) error
WalkBlocks For each Block in the array call the BlockVisitor functions
func WalkDocument ¶
func WalkDocument(document *doc.Document, args []interface{}, fns ...BlockVisitor) error
WalkDocument For each Block in the Document call the BlockVisitor functions
Types ¶
type BlockReplacement ¶
type BlockSorter ¶
func NewBlockSorter ¶
func NewBlockSorter(blockSortOrder map[string]int) BlockSorter
func (BlockSorter) Len ¶
func (b BlockSorter) Len() int
func (BlockSorter) Less ¶
func (b BlockSorter) Less(i, j int) bool
func (*BlockSorter) SortBlocks ¶
func (b *BlockSorter) SortBlocks(blocks []doc.Block) []doc.Block
func (BlockSorter) Swap ¶
func (b BlockSorter) Swap(i, j int)
type InvalidArgumentError ¶
func (InvalidArgumentError) Error ¶
func (e InvalidArgumentError) Error() string
func (InvalidArgumentError) Is ¶
func (e InvalidArgumentError) Is(target error) bool
func (InvalidArgumentError) Unwrap ¶
func (e InvalidArgumentError) Unwrap() error
type MalformedDocumentError ¶
type MalformedDocumentError struct {
// contains filtered or unexported fields
}
func (*MalformedDocumentError) Error ¶
func (e *MalformedDocumentError) Error() string
type RequiredArgumentError ¶
func (RequiredArgumentError) Error ¶
func (e RequiredArgumentError) Error() string
func (RequiredArgumentError) Is ¶
func (e RequiredArgumentError) Is(target error) bool
func (RequiredArgumentError) Unwrap ¶
func (e RequiredArgumentError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.