manifest

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirType

type DirType struct {
	// Dir name of dir
	Dir string `yaml:"dir,omitempty"`
	// Structure is the node content of dir
	Structure []*Node `yaml:"structure,omitempty"`
}

DirType represents a directory node

type FileType

type FileType struct {
	// File is the renaming of the file from source. If Source is empty then File should contain the url
	File string `yaml:"file,omitempty"`
	// Source is the source of file. If empty File must be the url
	Source string `yaml:"source,omitempty"`
	// MultiSource is a file build from multiple sources
	MultiSource []string `yaml:"multiSource,omitempty"`
}

FileType represent a file node

type FilesTreeType

type FilesTreeType struct {
	// FileTree is a tree url of a repo
	FileTree string `yaml:"fileTree,omitempty"`
	// ExcludeFiles files to be excluded
	ExcludeFiles []string `yaml:"excludeFiles,omitempty"`
}

FilesTreeType represents a fileTree node

type ManifType

type ManifType struct {
	// Manifest is the manifest url
	Manifest string `yaml:"manifest,omitempty"`
	// contains filtered or unexported fields
}

ManifType represents a manifest node

type Manifest

type Manifest struct {
	Node
	// URL of manifest
	URL string
}

Manifest represents a manifest document

type Node

type Node struct {
	ManifType `yaml:",inline"`

	FileType `yaml:",inline"`

	DirType `yaml:",inline"`

	FilesTreeType `yaml:",inline"`

	// Properties of the node
	Properties map[string]interface{} `yaml:"properties,omitempty"`
	// Frontmatter of the node
	Frontmatter map[string]interface{} `yaml:"frontmatter,omitempty"`
	// Type of node
	Type string `yaml:"type,omitempty"`
	// Path of node
	Path string `yaml:"path,omitempty"`
	// contains filtered or unexported fields
}

Node represents a generic mnifest node

func ResolveManifest

func ResolveManifest(url string, r resourcehandlers.Registry) ([]*Node, error)

ResolveManifest collects files in FileCollector from a given url and resourcehandlers.FileSource

func (*Node) HasContent

func (n *Node) HasContent() bool

HasContent returns true if the node is a document node

func (*Node) HugoPrettyPath

func (n *Node) HugoPrettyPath() string

HugoPrettyPath returns hugo pretty path

func (*Node) Name

func (n *Node) Name() string

Name is the name of the node

func (*Node) NodePath

func (n *Node) NodePath() string

NodePath returns fully qualified name of this node i.e. Node.Path + Node.Name

func (*Node) Parent

func (n *Node) Parent() *Node

Parent is the node parent

func (*Node) String

func (n *Node) String() string

type ParsingOptions

type ParsingOptions struct {
	ExtractedFilesFormats []string `mapstructure:"extracted-files-formats"`
	Hugo                  bool     `mapstructure:"hugo"`
}

ParsingOptions Options that are given to the parser in the api package

Jump to

Keyboard shortcuts

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