IsGoogle

package module
v0.0.0-...-c709aaa Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: MIT Imports: 2 Imported by: 0

README

IsGoogle

Performs a reverse lookup for a certain ip to check if it belongs to Google crawlers

Golang port of is-google nodejs package, it allows to verify that a web crawler is visiting your server using the Google specs.

Get

go get https://github.com/dlion/IsGoogle

Example

package main

import (
	"fmt"

	. "github.com/dlion/IsGoogle"
)

const (
	ip = "66.249.66.1"
)

func main() {
	answer, err := IsGoogle(ip)
	if err != nil {
		panic(err)
	}

	fmt.Printf("The address %s is belongs to Google: %v\n", ip, answer)
}

Tests

go test

A little copying is better than a little dependency

Yea, I know that but in my use case is not true :yolo:

License

MIT

Author

Domenico Luciani @DLion92 https://domenicoluciani.com

Thanks

Thank you Rocco Musolino for the idea

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsGoogle

func IsGoogle(addr string) (bool, error)

IsGoogle should check if a certain address belongs to Google

Types

This section is empty.

Jump to

Keyboard shortcuts

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