utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaultConfig added in v1.1.0

func ApplyDefaultConfig(config *viper.Viper) *viper.Viper

ApplyDefaultConfig initializes top level configuration and some options that fit best here

func ApplyDefaultEventElasticsearchConfig added in v1.1.0

func ApplyDefaultEventElasticsearchConfig(config *viper.Viper) *viper.Viper

ApplyDefaultEventElasticsearchConfig is called when the ElasticsearchEventHandler is initialized

func ApplyDefaultEventJSONFileConfig added in v1.1.0

func ApplyDefaultEventJSONFileConfig(config *viper.Viper) *viper.Viper

ApplyDefaultEventJSONFileConfig is called when the JSONFileEventHandler is initialized

func ApplyDefaultEventTerminalConfig added in v1.1.0

func ApplyDefaultEventTerminalConfig(config *viper.Viper) *viper.Viper

ApplyDefaultEventTerminalConfig is called when the TerminalEventHandler is initialized

func ApplyDefaultScannerConfig added in v1.1.0

func ApplyDefaultScannerConfig(config *viper.Viper) *viper.Viper

ApplyDefaultScannerConfig is called when the node applies the configuration sent by the server in order to have defaults in place

func ApplyDefaultScannerTCPConfig added in v1.1.0

func ApplyDefaultScannerTCPConfig(config *viper.Viper) *viper.Viper

ApplyDefaultScannerTCPConfig is called when the TCP scanner is initialized

func ApplyDefaultScannerUDPConfig added in v1.1.0

func ApplyDefaultScannerUDPConfig(config *viper.Viper) *viper.Viper

ApplyDefaultScannerUDPConfig is called when the UDP scanner is initialized

func ApplyDefaultScannerZgrab2HTTPConfig added in v1.1.0

func ApplyDefaultScannerZgrab2HTTPConfig(config *viper.Viper) *viper.Viper

ApplyDefaultScannerZgrab2HTTPConfig is called when Zgrab HTTP is initialized

func ApplyDefaultScannerZgrab2SSHConfig added in v1.1.0

func ApplyDefaultScannerZgrab2SSHConfig(config *viper.Viper) *viper.Viper

ApplyDefaultScannerZgrab2SSHConfig is called when Zgrab SSH is initialized

func ApplyDefaultTargetgeneratorCertificatetransparencyConfig added in v1.1.0

func ApplyDefaultTargetgeneratorCertificatetransparencyConfig(config *viper.Viper) *viper.Viper

ApplyDefaultTargetgeneratorCertificatetransparencyConfig sets default values for certificate transparency target generator

func ApplyDefaultTargetgeneratorLDAPConfig added in v1.1.0

func ApplyDefaultTargetgeneratorLDAPConfig(config *viper.Viper) *viper.Viper

ApplyDefaultTargetgeneratorLDAPConfig sets default values for ldap target generator

func ApplyDefaultTargetgeneratorStandardConfig added in v1.1.0

func ApplyDefaultTargetgeneratorStandardConfig(config *viper.Viper) *viper.Viper

ApplyDefaultTargetgeneratorStandardConfig sets default values for standard target generator

func CheckError

func CheckError(err error, critical bool)

CheckError provides general error handling

func DbgGetGID

func DbgGetGID() uint64

DbgGetGID returns the number of the goroutine calling this function. DEBUG ONLY!!

func JSONtoProtoValue

func JSONtoProtoValue(json []byte) (*structpb.Value, error)

JSONtoProtoValue converts any json to a protobuf value

func ReadFileLinesToStringSlice

func ReadFileLinesToStringSlice(filename string) ([]string, error)

ReadFileLinesToStringSlice takes a path as string, tries to open the file, reads its contents and returns the contents as string slice. Similar to Python's readlines()

Types

type Formatter

type Formatter struct {
	FieldsOrder     []string // default: fields sorted alphabetically
	TimestampFormat string   // default: time.StampMilli = "Jan _2 15:04:05.000"
	HideKeys        bool     // show [fieldValue] instead of [fieldKey:fieldValue]
	NoColors        bool     // disable colors
	NoFieldsColors  bool     // color only level, default is level + fields
	ShowFullLevel   bool     // true to show full level [WARNING] instead [WARN]
	TrimMessages    bool     // true to trim whitespace on messages
}

Formatter - logrus formatter, implements logrus.Formatter

func (*Formatter) Format

func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error)

Format an log entry

Jump to

Keyboard shortcuts

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