Help us shape the future of Go! Take the 2026 Go Developer Survey

gotld

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

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

Go to latest
Published: Aug 8, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

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: 2019-08-08 20:48:04

*

*
*

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

Jump to

Keyboard shortcuts

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