scan

package module
v0.0.0-...-32d28d5 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 5 Imported by: 0

README

scan

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// Filter - function accepts or rejects file
	Filter(file fs.DirEntry) bool
	// Format - function returns formatted text for selected files
	Format(file fs.DirEntry, folder *Folder) string
}

Builder - required functions

type Folder

type Folder struct {
	// Source - path of origin
	Source string
	// Destination - output path of file operations
	Destination string
	// Script - file name of stored generated text
	Script string
	// Code - generated formatted text
	Code string
	// Files - list of filtered files
	Files []fs.DirEntry
	// Children - sub folders
	Children []string
}

Folder - properties collected during scan

func (*Folder) Write

func (f *Folder) Write(cmd []byte) (err error)

Write - create folders and write output files

type Folders

type Folders []*Folder

Folders - collection

func Build

func Build(in, out, script string, builder Builder, write bool, verbose bool) (folders Folders, err error)

Build - returns input scan results in folders arguments:

	in - input base
	out - output base
 script - name of generated script
	builder - Builder interface to filter files and format scripts
 write - create folders and generate scripts
	verbose - display messages

func (Folders) Write

func (fs Folders) Write() (err error)

Write - folders and output files

Jump to

Keyboard shortcuts

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