Skip to content

Superredstone/goping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goping

A simple library to ping a certain ip. Besides that it can also perform port scanning (not very fast)

Install

go get github.com/Superredstone/goping

Example

package main

import (
	"fmt"
	"os"
	"time"

    "github.com/Superredstone/goping"
)

func main() {
	Opened, err := goping.Ping("127.0.0.1", "22", time.Duration(time.Duration(10)*time.Millisecond))
	if err != nil {
		os.Exit(1)
	}
	if Opened {
		fmt.Println("PORT 22 IS OPENED")
	} else {
		fmt.Println("PORT 22 IS CLOSED")
	}
}

About

A simple library to ping a certain ip.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages