Documentation
¶
Index ¶
- type FileData
- type Format
- type Generator
- func (g *Generator) Generate() (string, int, int, error)
- func (g *Generator) GenerateString() (string, int, int, error)
- func (g *Generator) GetFormat() Format
- func (g *Generator) GetFormatName() string
- func (g *Generator) PrepareTemplateData() (TemplateData, error)
- func (g *Generator) SetFormat(format Format)
- func (g *Generator) SetRedactionMode(redact bool)
- type Node
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format interface {
// Render converts the template data into the specific format
Render(data TemplateData) (string, int, error)
// Extension returns the file extension for this format
Extension() string
// Name returns the name of the format
Name() string
}
Format defines the interface for different output formats
type Generator ¶
type Generator struct {
SecretScanner secrets.Scanner
SelectedFiles map[string]bool
DeselectedFiles map[string]bool
GitIgnoreMgr *filesystem.GitIgnoreManager
FilterMgr *filesystem.FilterManager
OutputPath string
RootPath string
UseTempFile bool
UseGitIgnore bool
ShowHidden bool
RedactSecrets bool
// contains filtered or unexported fields
}
Generator organizes how we generate the output in different formats
func NewGenerator ¶
func NewGenerator(rootPath string, gitIgnoreMgr *filesystem.GitIgnoreManager, filterMgr *filesystem.FilterManager, outputPath string, useTempFile bool) *Generator
NewGenerator constructs a generator with default settings
func (*Generator) GenerateString ¶
GenerateString returns the rendered content as a string along with counts
func (*Generator) GetFormatName ¶
GetFormatName returns the name of the current format
func (*Generator) PrepareTemplateData ¶
func (g *Generator) PrepareTemplateData() (TemplateData, error)
PrepareTemplateData finalizes the selection, scans/redacts secrets, and builds TemplateData
func (*Generator) SetRedactionMode ¶ added in v1.0.3
SetRedactionMode enables or disables secret redaction.
type Node ¶
type Node struct {
Name string
Path string
Content string
Language string
Children []*Node
IsDir bool
Findings []secrets.Finding
}
Node represents a node in the in-memory file tree.
type TemplateData ¶
TemplateData is injected into the templates
Click to show internal directories.
Click to hide internal directories.