enom

package module
v0.0.0-...-888ce58 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 9 Imported by: 0

README

Go client for the enom API

Go Documentation builds.sr.ht status

Currently the scope is limited to the domains API: See https://api.enom.com/docs/domains

Status

The package is undergoing a significant refactoring at the moment. You can see an example of how it eventually should be used in cmd/enomcli/main.go.

Contributing

This project is part of the names.sr.ht effort. Patches and development discussion happen on the names.sr.ht-dev mailing list. For general discussions, there is names.sr.ht-discuss.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(resellerURL string, resellerID string, password string) Client

NewClient will create a new Enom API client

func (Client) Check

func (c Client) Check(domain Domain) (*response.DomainCheck, error)

Check checks the availability of a domain name.

Upstream documentation: https://api.enom.com/docs/check Note: the client always requests version 2.

func (Client) CheckNSStatus

func (c Client) CheckNSStatus(domain Domain, host string) (internal.CheckNSStatus, error)

CheckNSStatus Retrieve information about a name server

func (Client) Contacts

func (c Client) Contacts(domain Domain) (internal.Contacts, error)

Contacts Get all contact data for a domain name

func (Client) CreateTransferOrder

func (c Client) CreateTransferOrder(domain Domain, authInfo string) (internal.CreateTransferOrder, error)

CreateTransferOrder Transfer domains into an account

func (Client) Delete

func (c Client) Delete(domain Domain) (internal.Delete, error)

Delete deletes domain with in 5 days of purchase (Will not working on all accounts)

Upstream documentation: https://api.enom.com/docs/DeleteRegistration

func (Client) GetDNS

func (c Client) GetDNS(domain Domain) (internal.GetDNS, error)

func (Client) GetHosts

func (c Client) GetHosts(domain Domain) (internal.GetHosts, error)

GetHosts Get host records for a domain name.

func (Client) Info

func (c Client) Info(domain Domain) (*response.DomainInfo, error)

Info gets information about a single, registered domain name. It returns an error if the domain is not registered with enom.

Upstream documentation: https://api.enom.com/docs/getdomaininfo

func (Client) NameSpinner

func (c Client) NameSpinner(domain Domain, tldList string) (*response.NameSpinner, error)

NameSpinner lists related domain names

func (Client) Purchase

func (c Client) Purchase(domain Domain) (*response.DomainPurchase, error)

Purchase purchases a domain name

Upstream documentation: https://api.enom.com/docs/purchase

FIXME: docs say: Some TLDs, such as .de, requires you to specify name servers. The Registry will automatically delete the domain name if no name servers are specified.

func (Client) RegisterNameserver

func (c Client) RegisterNameserver(domain Domain, name string, ip string) (internal.RegisterNameserver, error)

RegisterNameserver Register a domain name server

func (Client) Renew

func (c Client) Renew(domain Domain, period uint64) (internal.Extend, error)

Renew extends (renews) the registration period for a domain name

Upstream documentation: https://api.enom.com/docs/extend

TODO stick to name "extend" to stay close to upstream?

func (Client) SetContact

func (c Client) SetContact(domain Domain, contactData map[string]string) (internal.Contacts, error)

SetContact Update contact information for a domain name

func (Client) SetHosts

func (c Client) SetHosts(req DomainSetHostRequest) (internal.Response, error)

SetHosts Set host records for a domain name

func (Client) SetRegLock

func (c Client) SetRegLock(domain Domain, enable bool) (*response.DomainInfo, error)

SetRegLock sets the registrar lock for a domain name

Upstream documentation: https://api.enom.com/docs/SetRegLock

func (Client) TldDetails

func (c Client) TldDetails(tld string) (*response.TldDetails, error)

TldDetails retrieves TLD characteristics in detail for a specified TLD

Upstream documentation: https://api.enom.com/docs/get-tld-details

func (Client) TldList

func (c Client) TldList() (response.TldList, error)

TldList retrieves a list of the TLDs that you offer

Upstream documentation: https://api.enom.com/docs/gettldlist

TODO: is this deprecated? It's not listed in the API calls menu

func (Client) TransferOrderDetail

func (c Client) TransferOrderDetail(id string) (internal.TransferOrderDetail, error)

TransferOrderDetail Get information for a single domain on a transfer order

func (Client) TransferOrderReview

func (c Client) TransferOrderReview(id string) (internal.TransferOrderReview, error)

TransferOrderReview Retrieve information on a transfer order

func (Client) TransferOrderStatuses

func (c Client) TransferOrderStatuses() (internal.TransferOrderStatuses, error)

TransferOrderStatuses Get a list of orders including Closed for the last 6 months

func (Client) UpdateNameserver

func (c Client) UpdateNameserver(domain Domain, name string, oldIp string, newIp string) (internal.UpdateNameserver, error)

UpdateNameserver Change the IP address of a name server in the Registry’s records

func (Client) WhoisContact

func (c Client) WhoisContact(domain Domain) (internal.WhoisContact, error)

WhoisContact Get Whois contact information for a domain name

type Domain

type Domain struct {
	// Name of the domain without the extension.
	// Must not contain any dots.
	Name string
	// The extesion that this domain is or should be registered under.
	Extension string
}

Domain represents a domain name with the extension it is registered under. The extension is sometimes referred to as TLD (top-level domain). This is misleading, though, as an extension can in fact have multiple levels (such as "com.es" or "co.uk"). Likewise, the name is sometimes referred to as SLD (second-level domain).

Examples: "enom.com" consists of the name "enom" and the extension "com", and "enom.co.uk" consists of the name "enom" and the extension "co.uk".

func NewDomain

func NewDomain(fqdn string) Domain

NewDomain returns a Domain struct for a given FQDN. The result is not guaranteed to be a valid, ownable domain. The function simply splits the input at the first dot. It is merely intended as a convenience.

type DomainSetHost

type DomainSetHost struct {
	HostName   string
	RecordType string
	Address    string
	MXPref     int
}

type DomainSetHostRequest

type DomainSetHostRequest struct {
	Domain Domain
	Hosts  []DomainSetHost
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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