namecheck

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: MIT Imports: 6 Imported by: 0

README

GoDoc Build Status codecov Go Report Card License

namecheck (nck)

Check your name idea availability with CLI

Installation

$ go get -u github.com/uwuh/namecheck/cmd/nck

Usage

$ nck help
Usage of nck:
  -code string
        specific channel code that you want to check
  -help
        show this message
  -list
        show available channel code list
  -name string
        your name idea that you want to check

$ nck -name uwuh

Checking uwuh
Please wait...

Status
V Available
X Not Available
? Unknown (e.g. Timeout)

V .org
V .io
V .co.id
V .name
V .co
V .us
V .xyz
V .info
X Twitter
V Google+
X Github
X .net
V Facebook
V .me
V .id
X YouTube
V .com
V Instagram

Duration: 2.099445s

Run in Docker

$ docker build -t namecheck .
$ docker run -it namecheck -name foo

License

See LICENSE

Documentation

Index

Constants

View Source
const (
	//StatusAvailable represents status when
	//the name is available on a channel
	StatusAvailable ChannelStatus = "V"

	//StatusNotAvailable represents status when
	//the name is not available on a channel
	StatusNotAvailable ChannelStatus = "X"

	//StatusUnknown represents status when there is
	//an unknown problem when checking the availability of the name
	StatusUnknown ChannelStatus = "?"

	//TypeDomain represents DNS channel type
	TypeDomain ChannelType = "domain"

	//TypeSocial represents Social media channel type
	TypeSocial ChannelType = "social"
)

Variables

View Source
var DefaultChannels = []*Channel{{
	Code: ".biz",
	URL:  "http://{name}.biz",
	Type: TypeDomain,
}, {
	Code: ".cc",
	URL:  "http://{name}.cc",
	Type: TypeDomain,
}, {
	Code: ".com",
	URL:  "http://{name}.com",
	Type: TypeDomain,
}, {
	Code: ".co",
	URL:  "http://{name}.co",
	Type: TypeDomain,
}, {
	Code: ".co.id",
	URL:  "http://{name}.co.id",
	Type: TypeDomain,
}, {
	Code: ".id",
	URL:  "http://{name}.id",
	Type: TypeDomain,
}, {
	Code: ".in",
	URL:  "http://{name}.info",
	Type: TypeDomain,
}, {
	Code: ".info",
	URL:  "http://{name}.info",
	Type: TypeDomain,
}, {
	Code: ".io",
	URL:  "http://{name}.io",
	Type: TypeDomain,
}, {
	Code: ".ly",
	URL:  "http://{name}.ly",
	Type: TypeDomain,
}, {
	Code: ".me",
	URL:  "http://{name}.me",
	Type: TypeDomain,
}, {
	Code: ".name",
	URL:  "http://{name}.name",
	Type: TypeDomain,
}, {
	Code: ".net",
	URL:  "http://{name}.net",
	Type: TypeDomain,
}, {
	Code: ".org",
	URL:  "http://{name}.org",
	Type: TypeDomain,
}, {
	Code: ".us",
	URL:  "http://{name}.us",
	Type: TypeDomain,
}, {
	Code: ".xyz",
	URL:  "http://{name}.xyz",
	Type: TypeDomain,
}, {
	Code: "Facebook",
	URL:  "https://facebook.com/{name}",
	Type: TypeSocial,
}, {
	Code: "YouTube",
	URL:  "https://youtube.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Instagram",
	URL:  "https://instagram.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Twitter",
	URL:  "https://twitter.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Github",
	URL:  "https://github.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Gitlab",
	URL:  "https://gitlab.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Bitbucket",
	URL:  "https://bitbucket.org/{name}",
	Type: TypeSocial,
}, {
	Code: "Reddit",
	URL:  "https://www.reddit.com/user/{name}",
	Type: TypeSocial,
}, {
	Code: "Medium",
	URL:  "https://www.medium.com/@{name}",
	Type: TypeSocial,
}, {
	Code: "Vimeo",
	URL:  "https://vimeo.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Artstation",
	URL:  "https://www.artstation.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Tumblr",
	URL:  "https://{name}.tumblr.com",
	Type: TypeSocial,
}, {
	Code: "Keybase.io",
	URL:  "https://keybase.io/{name}",
	Type: TypeSocial,
}, {
	Code: "Vkontakte",
	URL:  "https://vk.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Pinterest",
	URL:  "https://pinterest.com/{name}",
	Type: TypeSocial,
}, {
	Code: "Slack",
	URL:  "https://{name}.slack.com",
	Type: TypeSocial,
}, {
	Code: "Dev.to",
	URL:  "https://dev.to/{name}",
	Type: TypeSocial,
}}

DefaultChannels contains list of available channel

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Code   string
	URL    string
	Type   ChannelType
	Status ChannelStatus
	Error  error
}

Channel represents channel that will be checked

func Check

func Check(ctx context.Context, name string, baseChannel []*Channel) (channels []*Channel, duration time.Duration)

Check name availability on all channel

func FindChannelByCode added in v1.1.0

func FindChannelByCode(ctx context.Context, code string) (*Channel, error)

FindChannelByCode is used to find channel by its channel code

func FindChannelsByType added in v1.1.0

func FindChannelsByType(ctx context.Context, chType ChannelType) []*Channel

FindChannelsByType is used to find channels by its channel type

type ChannelStatus added in v1.1.0

type ChannelStatus string

ChannelStatus value

type ChannelType added in v1.1.0

type ChannelType string

ChannelType value

Directories

Path Synopsis
cmd
nck

Jump to

Keyboard shortcuts

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