Documentation ¶
Index ¶
- func BackwardsCompatiblePaths(templateDir string, oldPath string) string
- func PrintDeprecatedPathsMsgIfApplicable(isSilent bool)
- type DiskCatalog
- func (c *DiskCatalog) GetTemplatePath(target string) ([]string, error)
- func (c *DiskCatalog) GetTemplatesPath(definitions []string) ([]string, map[string]error)
- func (d *DiskCatalog) OpenFile(filename string) (io.ReadCloser, error)
- func (c *DiskCatalog) ResolvePath(templateName, second string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackwardsCompatiblePaths ¶
BackwardsCompatiblePaths returns new paths for all old/legacy template paths Note: this is a temporary function and will be removed in the future release
func PrintDeprecatedPathsMsgIfApplicable ¶
func PrintDeprecatedPathsMsgIfApplicable(isSilent bool)
PrintDeprecatedPathsMsgIfApplicable prints a warning message if any deprecated paths are found Unless mode is silent warning message is printed
Types ¶
type DiskCatalog ¶
type DiskCatalog struct {
// contains filtered or unexported fields
}
DiskCatalog is a template catalog helper implementation based on disk
func NewCatalog ¶
func NewCatalog(directory string) *DiskCatalog
NewCatalog creates a new Catalog structure using provided input items using disk based items
func (*DiskCatalog) GetTemplatePath ¶
func (c *DiskCatalog) GetTemplatePath(target string) ([]string, error)
GetTemplatePath parses the specified input template path and returns a compiled list of finished absolute paths to the templates evaluating any glob patterns or folders provided as in.
func (*DiskCatalog) GetTemplatesPath ¶
func (c *DiskCatalog) GetTemplatesPath(definitions []string) ([]string, map[string]error)
GetTemplatesPath returns a list of absolute paths for the provided template list.
func (*DiskCatalog) OpenFile ¶
func (d *DiskCatalog) OpenFile(filename string) (io.ReadCloser, error)
OpenFile opens a file and returns an io.ReadCloser to the file. It is used to read template and payload files based on catalog responses.
func (*DiskCatalog) ResolvePath ¶
func (c *DiskCatalog) ResolvePath(templateName, second string) (string, error)
ResolvePath resolves the path to an absolute one in various ways.
It checks if the filename is an absolute path, looks in the current directory or checking the nuclei templates directory. If a second path is given, it also tries to find paths relative to that second path.