forked from vdjagilev/nmap-formatter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat.go
31 lines (28 loc) · 1.44 KB
/
format.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package formatter
// OutputFormat is a resulting type of file that is converted/formatted from XML to HTML (for example)
type OutputFormat string
const (
// HTMLOutput constant defines OutputFormat is HyperText Markup Language which can be viewed using browsers
HTMLOutput OutputFormat = "html"
// CSVOutput constant defines OutputFormat for Comma-Separated Values CSV file which is viewed most of the time in Excel
CSVOutput OutputFormat = "csv"
// MarkdownOutput constant defines OutputFormat for Markdown, which is handy and easy format to read-write
MarkdownOutput OutputFormat = "md"
// JSONOutput constant defines OutputFormat for JavaScript Object Notation, which is more useful for machine-related operations (parsing)
JSONOutput OutputFormat = "json"
// DotOutput constant defined OutputFormat for Dot (Graphviz), which can be used to generate various graphs
DotOutput OutputFormat = "dot"
// SqliteOutput constant defines OutputFormat for sqlite file, which can be used to generate sqlite embedded databases
SqliteOutput OutputFormat = "sqlite"
// ExcelOutput constant defines OutputFormat for Excel file, which can be used to generate Excel files
ExcelOutput OutputFormat = "excel"
)
// IsValid checks whether requested output format is valid
func (of OutputFormat) IsValid() bool {
// markdown & md is essentially the same thing
switch of {
case "markdown", "md", "html", "csv", "json", "dot", "sqlite", "excel":
return true
}
return false
}