gotld

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

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

Go to latest
Published: Mar 11, 2023 License: BSD-2-Clause Imports: 4 Imported by: 1

README

gotld

Get domain's tld by go

Install gotld

go get github.com/forease/gotld

Import gotld

import "github.com/forease/gotld"

Use gotld

For example.

tld, domain, err := gotld.GetTld( *url )
if err != nil {
    fmt.Println( err )
    return
}
fmt.Printf( "TLD: %s, Domain: %s\n", tld.Tld, domain )

About

北京实易时代科技有限公司
Beijing ForEase Times Technology Co., Ltd.
http://www.forease.net

Contact me

Jonsen Yang
im16hot#gmail.com (replace # with @)

Documentation

Overview

create time: 2023-03-11 10:52:50

*

*
*

Index

Constants

View Source
const (
	GOTLD_VERSION = "gotld V1.3"
)

Variables

This section is empty.

Functions

func GetSubdomain

func GetSubdomain(url string, level int) (subdomain, domain, tld string)

GetSubdomain 获取子域名

func GetVersion

func GetVersion() string

GetVersion -

Types

type TldItem

type TldItem struct {
	Id                     int32
	Country, Tld, Category string
	Lables                 int
}

TldItem tld item

func GetTld

func GetTld(url string) (tld TldItem, domain string, err error)

GetTld 获取域名

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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