Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "trace2neo", Short: "A brief description of your application", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your application. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { if verbose { logrus.SetLevel(logrus.DebugLevel) } for _, ip := range args { netip := net.ParseIP(ip) if netip == nil { logrus.Errorf("Argument %s was not an IP. Skipping...", ip) continue } result, err := trace2neolib.RunTraceroute(netip) if err != nil { logrus.WithError(err).Errorln("Failed to run traceroute.") continue } processedResults, err := trace2neolib.ProcessTracerouteOutput(result) if err != nil { logrus.WithError(err).Errorln("Failed to process traceroute output.") } for _, processedResult := range processedResults { logrus.Debugf("Hop: %s, Destination: %s, DNS Host: %s, IP: %s, RTT1: %s, RTT2: %s, RTT3: %s", processedResult.Hop, processedResult.Destination, processedResult.DNSName, processedResult.IP, processedResult.RTT1, processedResult.RTT2, processedResult.RTT3) } } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.