domaincheck

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 4 Imported by: 2

README

domaincheck

A domain name availability checker, using whois client and regexp.

Install

go get github.com/twiny/domaincheck

API

NewChecker() (*Checker, error)
Check(ctx context.Context, domain string) (DomainStatus, error)

Example

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/twiny/domaincheck"
)

func main() {
    checker, err := domaincheck.NewChecker()
    if err != nil {
        log.Fatal(err)
    }

    status, err := checker.Check(context.Background(), "example.com")
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(status)
}

Bugs

Bugs or suggestions? Please visit the issue tracker.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker

func NewChecker

func NewChecker() (*Checker, error)

NewChecker

func (*Checker) Check

func (c *Checker) Check(ctx context.Context, domain string) (DomainStatus, error)

Check

type DomainStatus

type DomainStatus string
const (
	NotApplicable DomainStatus = "N/A"
	Available     DomainStatus = "available"
	Registered    DomainStatus = "registered"
	Premium       DomainStatus = "premium"
)

func (DomainStatus) String

func (s DomainStatus) String() string

String

Jump to

Keyboard shortcuts

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