Documentation ¶
Index ¶
- Constants
- func Extract[T any](node *Node[T], outputPath string, isSkipped func(*Node[T]) bool) error
- func List(r io.Reader) ([]string, error)
- type Node
- func (n Node[T]) GetChildren() []*Node[T]
- func (n Node[T]) GetData() []byte
- func (n Node[T]) GetDirChildren() []*Node[T]
- func (n *Node[T]) GetParent() *Node[T]
- func (n Node[T]) GetPath() string
- func (n *Node[T]) GetRoot() *Node[T]
- func (n Node[T]) IsRoot() bool
- func (n Node[T]) LenChildren() int
- func (n *Node[T]) OnNestedChildren(cb func(*Node[T]) error) error
- type NodeExistError
- type SimpleNode
Constants ¶
View Source
const ExtractFolder = "guntar_extracted"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node[T any] struct { fs.FileInfo Spec T // Spec is the additionalData that users can set on node creation // contains filtered or unexported fields }
func Scan ¶
Scan through a reader (file,string,etc...) with a tar archive and return the root directory node of the archive, Node is a generic type, you can implement it with the callback Node type eg: func(n *Node[struct{}]) The type T is used to add additionnal data into each nodes on creation. It let the possibility to initialize each node.
func (Node[T]) GetChildren ¶
func (Node[T]) GetDirChildren ¶
GetDirChildren return the node's directory children
func (Node[T]) LenChildren ¶
type NodeExistError ¶
type NodeExistError struct {
// contains filtered or unexported fields
}
func (NodeExistError) Error ¶
func (n NodeExistError) Error() string
type SimpleNode ¶
type SimpleNode = Node[struct{}]
Click to show internal directories.
Click to hide internal directories.