Skip to content

Commit

Permalink
some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
5amu committed Jul 6, 2022
1 parent b2c4160 commit ef95a53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/common/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package common

const (
DNSHunterVersion = "0.1"
// DNSHunterVersion tracks the version of the program
DNSHunterVersion = "v1.0-dev"
// DefaultNameserver is used when no other nameserver has been specified
// it is equivalent to dns.google.com
DefaultNameserver = "8.8.8.8"
// DNSAmplificationThreshold is an arbitrary number that the programmer
// considered to be enough for "response considerably larger than request"
Expand Down
8 changes: 8 additions & 0 deletions internal/common/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,30 @@ func generic(s string, color string) string {
return fmt.Sprintf("%v%v%v", color, s, colors[Reset])
}

// Banner formats the provided string into banner format
func Banner(s string) string {
return generic(s, colors[BannerLevel])
}

// Info formats the provided string into info format
func Info(s string) string {
return generic(s, colors[InfoLevel])
}

// Warn formats the provided string into warning format
// it is used when a portion of a check detects a vulnerability
func Warn(s string) string {
return generic(fmt.Sprintf("[WARNING]: %v", s), colors[WarnLevel])
}

// Header formats the provided string into header format
// it is used to format header of the output for a check
func Header(s string) string {
return generic(fmt.Sprintf("[!] %v [!]", s), colors[HeaderLevel])
}

// Error formats the provided string into error format
// it is used to format errors to be printed out on stdout
func Error(s string) string {
return generic(fmt.Sprintf("[ERROR]: %v", s), colors[ErrorLevel])
}

0 comments on commit ef95a53

Please sign in to comment.