shogo/internal/shodan/myip.go

22 lines
405 B
Go
Raw Normal View History

package shodan
import (
"context"
"fmt"
2024-05-29 00:42:40 +00:00
"git.supernets.org/perp/shogo/internal/utils"
)
// Return your IP address
func (s *Shodan) MyIp() {
// Fetch IP address
results, err := utils.Client.GetMyIP(context.Background())
if err != nil {
s.Results <- fmt.Sprintf("%s: %s", utils.Red("Error"), err.Error())
return
}
// Send line
s.Results <- fmt.Sprintf("%s", utils.Blue(results.String()))
}