Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GeoIPCmd = &cobra.Command{ Use: "geoip", Short: "Lookup Geo information for an IP", Long: "", Run: func(cmd *cobra.Command, args []string) { ip, err := cmd.Flags().GetString("ip") if err != nil { log.Fatalf("Error fetching flags %s", err) } if ip == "" { cmd.Help() return } record, err := maxmind.IP2Geo(ip) if err != nil { log.Fatalf("Error fetching record: %s", err) } b, err := json.MarshalIndent(record, "", " ") if err != nil { log.Fatalf("Error parsing record: %s", err) } fmt.Println(string(b)) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.