tranco

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

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

Go to latest
Published: Jan 28, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

README

tranco

package to access to the Tranco list, published at https://tranco-list.eu.

Usage


import github.com/mustafaocak/tranco

Create a variable of type TrancoList

var tl tranco.TrancoList

To get the latest tranco list

t.Should_cache = true
tl = t.List("latest")

To get the rank info a domain in the list

fmt.Println(tl.Rank("google.com"))

To get top 10 elements of the list

fmt.Println(tl.Top(10))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Rank int
	Name string
}

type Tranco

type Tranco struct {
	Should_cache bool
	Cache_dir    string
}

func (Tranco) List

func (t Tranco) List(date string) TrancoList

type TrancoList

type TrancoList struct {
	Date         string
	List_id      string
	List_page    string
	Domains_list []Domain
	Domains_map  map[string]int
}

func (TrancoList) Rank

func (tl TrancoList) Rank(domainname string) int

func (TrancoList) Top

func (tl TrancoList) Top(num int) []Domain

Jump to

Keyboard shortcuts

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