versio

package module
v0.0.0-...-7c492b9 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2014 License: MIT Imports: 8 Imported by: 0

README

Go-Versio-API

The API for using the Versio ( http://www.versio.nl/ ) interface using the language Go. An account at Versio is required.

Usage

import (
    "net/url"
    "github.com/HuperWebs/versio"
)
One time, initialization
versio.Initialize("12345", "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", false)
Per query, either one of the following:
(a) Use 'raw' Send-function
// Prepare query data
data := url.Values{}
data.Set("command",	    "DomainsCheckAvailability")
data.Set("domain", 	    "example")
data.Set("tld",	        "com")

// Actually making request
mapped, err := versio.Send(data)
if err != nil {
	// error handling ...
}

// using mapped["success"] and others ...
(b) Use implemented command
mapped, err := versio.DomainsCheckAvailability("domain", "tld")
if err != nil { 
	// error handling .
}

// using mapped["success"] and others ...

Documentation

Documentation of the Golang implementation is available at https://godoc.org/github.com/HuperWebs/versio

GoDoc

Documentation of the Versio API is available in the PHP-version download at http://www.versio.nl/api.php

Documentation

Overview

Package versio allows access to the Versio-API. Download the PHP-vesion at http://www.versio.nl/api.php for API documentation.

Index

Constants

View Source
const (
	RecordTypeA     RecordType = "A"
	RecordTypeAAAA  RecordType = "AAAA"
	RecordTypeMX    RecordType = "MX"
	RecordTypeCNAME RecordType = "CNAME"
	RecordTypePTR   RecordType = "PTR"
	RecordTypeSRV   RecordType = "SRV"
	RecordTypeTxt   RecordType = "TXT"
	RecordTypeSPF   RecordType = "SPF"
	TTLValue300     TTLValue   = "300"
	TTLValue3600    TTLValue   = "3600"
	TTLValue7200    TTLValue   = "7200"
	TTLValue14400   TTLValue   = "14400"
	TTLValue28800   TTLValue   = "28800"
	TTLValue86400   TTLValue   = "86400"
)

Variables

This section is empty.

Functions

func DNSTemplateAddRecord

func DNSTemplateAddRecord(template_id int, name string, rtype RecordType, value string, prio int, ttl TTLValue) (map[string]string, error)

DNSTemplateAddRecord adds a new DNS record for the given template. Any prio-value <= 0 will omit the optional prio-parameter.

func DNSTemplatesAddRedirection

func DNSTemplatesAddRedirection(template_id int, from string, to url.URL) (map[string]string, error)

DNSTemplatesAddRedirection adds a new redirect-record for the given DNS template

func DNSTemplatesCreate

func DNSTemplatesCreate(template_name string) (map[string]string, error)

DNSTemplatesCreate creates a new (empty) DNS template with given name

func DNSTemplatesDelete

func DNSTemplatesDelete(template_id int) (map[string]string, error)

DNSTemplatesDelete removes a template from the list of templates.

func DNSTemplatesDeleteRecord

func DNSTemplatesDeleteRecord(record_id int) (map[string]string, error)

DNSTemplatesDeleteRecord removes a DNS record from a DNS template, DNSListRecordsFromTemplate returns the required Record-ID.

func DNSTemplatesDeleteRedirection

func DNSTemplatesDeleteRedirection(record_id int) (map[string]string, error)

DNSTemplatesDeleteRedirection removes a DNS-redirect-record from a DNS template, DNSListRecordsFromTemplate returns the required Record-ID.

func DNSTemplatesList

func DNSTemplatesList() (map[string]string, error)

DNSTemplatesList returns a list of DNS templates

func DNSTemplatesListRecords

func DNSTemplatesListRecords(template_id int) (map[string]string, error)

DNSTemplatesListRecords returns the DNS records of a selected DNS template

func DNSTemplatesListRedirections

func DNSTemplatesListRedirections(template_id int) (map[string]string, error)

DNSTemplatesListRedirections shows a list of DNS redirections of a selected DNS template

func DomainsChangeCategory

func DomainsChangeCategory(domain, tld string, category_id int) (map[string]string, error)

DomainsChangeCategory removes a domain-category from the list

func DomainsChangeDNSTemplate

func DomainsChangeDNSTemplate(domain, tld string, template int) (map[string]string, error)

DomainsChangeDNSTemplate changes the DNS template of the domain

func DomainsChangeOwner

func DomainsChangeOwner(domain, tld string, newcontact_id int, eppcode string) (map[string]string, error)

DomainsChangeOwner changes the domain holder for a domain name. NOTE: this is not always free of charge! EPP-code is only for .BE domain-names.

func DomainsCheckAvailability

func DomainsCheckAvailability(domain, tld string) (map[string]string, error)

DomainsCheckAvailability check whether or not the domain name is available. Limited usage: 100 + 8 * registered-domains.

func DomainsCreateCategory

func DomainsCreateCategory(category_name string) (map[string]string, error)

DomainsCreateCategory creates a new (empty) DNS category with the given name

func DomainsCreateContact

func DomainsCreateContact(companyname, initials, surname, email, phone, street, hnr, hnradd, zipcode, city, country string) (map[string]string, error)

DomainsCreateContact adds a new contact. Optional parameters may be left empty (""), and other info available at API documentation.

func DomainsDNSAddRecord

func DomainsDNSAddRecord(domain, tld, name string, recordType RecordType, value string, prio int, ttl TTLValue) (map[string]string, error)

DomainsDNSAddRecord adds a new DNS record for the domain. Any prio-value <= 0 will omit the optional prio-parameter.

func DomainsDNSAddRedirection

func DomainsDNSAddRedirection(domain, tld, from, to string) (map[string]string, error)

DomainsDNSAddRedirection changes the DNS template of the domain, using a string as parameter value

func DomainsDNSAddRedirectionURL

func DomainsDNSAddRedirectionURL(domain, tld, from string, to url.URL) (map[string]string, error)

DomainsDNSAddRedirectionURL changes the DNS template of the domain, using a url.URL as parameter value

func DomainsDNSDeleteRecord

func DomainsDNSDeleteRecord(domain, tld string, id int) (map[string]string, error)

DomainsDNSDeleteRecord deletes a DNS record for a domain

func DomainsDNSDeleteRedirection

func DomainsDNSDeleteRedirection(domain, tld string, id int) (map[string]string, error)

DomainsDNSDeleteRedirection changes the DNS template of the domain

func DomainsDNSListRecords

func DomainsDNSListRecords(domain, tld string) (map[string]string, error)

DomainsDNSListRecords lists the DNS records for the domain

func DomainsDNSListRedirections

func DomainsDNSListRedirections(domain, tld string) (map[string]string, error)

DomainsDNSListRedirections returns a list of redirections for the domain

func DomainsDNSOff

func DomainsDNSOff(domain, tld string) (map[string]string, error)

DomainsDNSOff turns off DNS administration for domain

func DomainsDNSon

func DomainsDNSon(domain, tld string) (map[string]string, error)

DomainsDNSon turns on DNS administration for domain

func DomainsDelete

func DomainsDelete(domain, tld string) (map[string]string, error)

DomainsDelete deletes / declaims the domain name.

func DomainsDeleteCategory

func DomainsDeleteCategory(category_id int) (map[string]string, error)

DomainsDeleteCategory removes a domain-category from the list

func DomainsDeleteContact

func DomainsDeleteContact(contact_id int) (map[string]string, error)

DomainsDeleteContact deletes a single contact from the list

func DomainsGetEPP

func DomainsGetEPP(domain, tld string) (map[string]string, error)

DomainsGetEPP returns the EPP token for .COM/NET?INFO/BIZ/ORG extensions. May be unavailable - in that case: use DomainsSendEPP.

func DomainsGetToken

func DomainsGetToken(domain, tld string) (map[string]string, error)

DomainsGetToken returns the transfer-token for a domain name (ONLY for .NL domain names)

func DomainsListActive

func DomainsListActive() (map[string]string, error)

DomainsListActive gives a list of active domain names, with expiration date, auto-renew setting and nameservers.

func DomainsListCategories

func DomainsListCategories() (map[string]string, error)

DomainsListCategories returns a list of domain categories

func DomainsListContacts

func DomainsListContacts() (map[string]string, error)

DomainsListContacts shows all contacts available

func DomainsListCountries

func DomainsListCountries() (map[string]string, error)

DomainsListCountries lists the available countries along with country codes available.

func DomainsListInactive

func DomainsListInactive() (map[string]string, error)

DomainsListInactive gives a list of inactive domain names, with expiration date, auto-renew setting and nameservers.

func DomainsListSingle

func DomainsListSingle(domain, tld string) (map[string]string, error)

DomainsListSingle gives information for one domain name, such as expiration date, auto-renew setting and nameservers.

func DomainsListSingleContact

func DomainsListSingleContact(contact_id int) (map[string]string, error)

DomainsListSingleContact shows a single contact

func DomainsListTransferredAway

func DomainsListTransferredAway() (map[string]string, error)

DomainsListTransferredAway shows a list domains that were transferred in the past 30 days, including a timestamp of each transfer.

func DomainsListTransfers

func DomainsListTransfers() (map[string]string, error)

DomainsListTransfers shows a list of ongoing domain transfers, with information such as transfer status, text, and update time.

func DomainsSendEPP

func DomainsSendEPP(domain, tld string) (map[string]string, error)

DomainsSendEPP sends the EPP-code for a .COM/NET/INFO/BIZ/ORG extension to the administrator of the domain (WHOIS). This domain does NOT have to be in your account to do this.

func DomainsSendEPP_be

func DomainsSendEPP_be(domain, tld string) (map[string]string, error)

DomainsSendEPP_be sends the EPP-code for a .BE extension to the domain holder. This domain does NOT have to be in your account to do this.

func DomainsTLDInfo

func DomainsTLDInfo(tld string) (map[string]string, error)

DomainsTLDInfo retrieves a list of available extensions (pricing included). If tld is nil, all extensions will be checked.

func Initialize

func Initialize(ClientNumber, ClientPassword string, SandboxMode bool)

Initialize sets the required variables (i.e. Password) for the Versio-API authentication. The password has to be SHA1-hashed already.

func Send

func Send(CommandParameters url.Values) (map[string]string, error)

Send creates a POST-request for the given values to the API server. Returns the response as a map with keys such as 'success'.

func SendWithChannel

func SendWithChannel(CommandParameters url.Values, ch chan map[string]string)

Send with channel is similar to 'Send', but sends the return-value to the given channel instead. Panics on error.

Types

type RecordType

type RecordType string

type TTLValue

type TTLValue string

Jump to

Keyboard shortcuts

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