synthient

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrApi = errors.New("error from API")

Error encountered when making a request to the API. Given when the response is not within the 200-299 range

Functions

func OpenKeyring

func OpenKeyring() (keyring.Keyring, error)

func ReadApiKey

func ReadApiKey(ring keyring.Keyring) (string, error)

func StoreApiKey

func StoreApiKey(ring keyring.Keyring, key string) error

Types

type Client

type Client struct {
	ApiKey string
	Base   *url.URL
	// contains filtered or unexported fields
}

func CreateClient

func CreateClient(config conf.Config) (Client, error)

func (*Client) LookupIP

func (client *Client) LookupIP(ip string) (LookupResponse, error)

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type LookupResponse

type LookupResponse struct {
	IP      string `json:"ip"`
	Network struct {
		Asn        int         `json:"asn"`
		Isp        string      `json:"isp"`
		Type       string      `json:"type"`
		Org        interface{} `json:"org"`
		AbuseEmail interface{} `json:"abuse_email"`
		AbusePhone interface{} `json:"abuse_phone"`
		Domain     interface{} `json:"domain"`
	} `json:"network"`
	Location struct {
		City      string  `json:"city"`
		State     string  `json:"state"`
		Country   string  `json:"country"`
		Timezone  string  `json:"timezone"`
		Longitude float64 `json:"longitude"`
		Latitude  float64 `json:"latitude"`
		GeoHash   string  `json:"geo_hash"`
	} `json:"location"`
	IPData struct {
		DeviceCount int           `json:"device_count"`
		Devices     []interface{} `json:"devices"`
		Behavior    []string      `json:"behavior"`
		Categories  []string      `json:"categories"`
		IPRisk      int           `json:"ip_risk"`
		Enriched    []struct {
			Provider string `json:"provider"`
			Type     string `json:"type"`
			LastSeen string `json:"last_seen"`
		} `json:"enriched"`
	} `json:"ip_data"`
}

func (LookupResponse) Output

func (r LookupResponse) Output(out *os.File, styles output.Styles, spacing bool)

func (LookupResponse) OutputCSV

func (r LookupResponse) OutputCSV(writer *csv.Writer)

Jump to

Keyboard shortcuts

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