Usom

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

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

Go to latest
Published: Feb 21, 2018 License: MIT Imports: 7 Imported by: 0

README

Usom Url Scanner

Scan usom blocked url list inside your ip masks.

Usage

go get -u github.com/netinternet/usom

Example

speed values is 1(highest speed) => 1000(lowest speed)



package main

import (
	"fmt"
	"github.com/netinternet/usom"
)

func main() {
	masks := []string{"89.43.28.0/22", "89.43.26.0/22"}
	speed := 10
	list := usom.Scan(masks, speed)
	for _, v := range list {
		fmt.Println(v.Hostname, v.IP)
	}
}



Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanurl

func Cleanurl(url string) string

clean up the url distorting characters

func Isinside

func Isinside(adress string, masks []string) net.IP

the given ip address on the ip mask return ip address or nil

usage : isInside("192.168.1.5", "{'192.168.1.0/24'}")

func Scandaily

func Scandaily(masks []string, speed int) map[string]interface{}

Types

type Pong

type Pong struct {
	IP       string
	Hostname string
}

func Scan

func Scan(masks []string, speed int) []Pong

Scan usom blocked url list inside your ip mask if it find , assign list struct slice masks are contains ip ranges ex: var masks = []string{"31.192.208.0/21", "89.43.28.0/22"} the speed sleep down as the speed values increases

usage: Scan(masks, 10)

if view the results

list := Scan(masks,10)
for _, v := range list {
	fmt.Println(v.Hostname, v.IP)
}

type UrlInfo

type UrlInfo struct {
	XMLName xml.Name `xml:"url-info"`
	Id      int32    `xml:"id"`
	Url     string   `xml:"url"`
	Desc    string   `xml:"desc"`
	Source  string   `xml:"source"`
	Date    string   `xml:"date"`
}

type UrlList

type UrlList struct {
	XMLName xml.Name  `xml:"url-list"`
	UrlInfo []UrlInfo `xml:"url-info"`
}

type UsomData

type UsomData struct {
	XMLName xml.Name `xml:"usom-data"`
	XMLInfo XMLInfo  `xml:"xml-info"`
	UrlList UrlList  `xml:"url-list"`
}

XML Parsing Structs for https://www.usom.gov.tr/url-list.xml

type XMLInfo

type XMLInfo struct {
	XMLName xml.Name `xml:"xml-info"`
	Updated string   `xml:"updated"`
	Author  string   `xml:"author"`
}

Jump to

Keyboard shortcuts

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