Skip to content
/ url Public

A tiny package that extracts your URLs by validating them.

License

Notifications You must be signed in to change notification settings

zeoagency/url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZEO.ORG - URL

A tiny package that extracts your URLs by validating them.

Usage

package main

import (
	"fmt"
	"log"

	"github.com/zeoagency/url"
)

func main() {
	u, err := url.NewURL("https://an.awesome.blog.boratanrikulu.dev.tr/blog/archlinux-install.html?q=a+lovely+query&z=another+query")
	if err != nil {
		log.Fatalln(err)
	}

	fmt.Println(u.Subdomains)     // ["an", "awesome", "blog"]
	fmt.Println(u.Domain)         // "boratanrikulu"
	fmt.Println(u.TLD)            // "dev"
	fmt.Println(u.CTLD)           // "tr"
	fmt.Println(u.FullDomain)     // "an.awesome.blog.boratanrikulu.dev.tr"
	fmt.Println(u.Path)           // "/blog/archlinux-install.html"
	fmt.Println(u.Queries)        // map[q:["a", "lovely", "query"], z:["another", "query"]
	fmt.Println(u.IsLive())       // false
	fmt.Println(u.IsRecorded())   // false
}

About

A tiny package that extracts your URLs by validating them.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages