Documentation
¶
Index ¶
- Constants
- Variables
- func IgnoreEOF(err error) error
- type Bool
- type Conn
- func (c *Conn) CheckDomain(domains ...string) (*DomainCheckResponse, error)
- func (c *Conn) CheckDomainExtensions(domains []string, extData map[string]string) (*DomainCheckResponse, error)
- func (c *Conn) Close() error
- func (c *Conn) DomainInfo(domain string, extData map[string]string) (*DomainInfoResponse, error)
- func (c *Conn) Hello() error
- func (c *Conn) Login(user, password, newPassword string) error
- func (c *Conn) Logout() error
- func (c *Conn) ReadRawResponse() ([]byte, error)
- func (c *Conn) SendFrame(frame []byte) error
- type DomainCharge
- type DomainCheck
- type DomainCheckResponse
- type DomainInfoResponse
- type Greeting
- type Response
- type Result
- type Status
- type Time
Constants ¶
const ( ObjDomain = "urn:ietf:params:xml:ns:domain-1.0" ObjHost = "urn:ietf:params:xml:ns:host-1.0" ObjContact = "urn:ietf:params:xml:ns:contact-1.0" ObjFinance = "http://www.unitedtld.com/epp/finance-1.0" ExtSecDNS = "urn:ietf:params:xml:ns:secDNS-1.1" ExtRGP = "urn:ietf:params:xml:ns:rgp-1.0" ExtLaunch = "urn:ietf:params:xml:ns:launch-1.0" ExtIDN = "urn:ietf:params:xml:ns:idn-1.0" ExtCharge = "http://www.unitedtld.com/epp/charge-1.0" ExtFee05 = "urn:ietf:params:xml:ns:fee-0.5" ExtFee06 = "urn:ietf:params:xml:ns:fee-0.6" ExtFee07 = "urn:ietf:params:xml:ns:fee-0.7" ExtFee08 = "urn:ietf:params:xml:ns:fee-0.8" ExtFee09 = "urn:ietf:params:xml:ns:fee-0.9" ExtFee11 = "urn:ietf:params:xml:ns:fee-0.11" ExtFee21 = "urn:ietf:params:xml:ns:fee-0.21" ExtFee10 = "urn:ietf:params:xml:ns:epp:fee-1.0" ExtPrice = "urn:ar:params:xml:ns:price-1.1" ExtNamestore = "http://www.verisign-grs.com/epp/namestoreExt-1.1" ExtNeulevel = "urn:ietf:params:xml:ns:neulevel" ExtNeulevel10 = "urn:ietf:params:xml:ns:neulevel-1.0" )
EPP extension URNs
const ( // EPP defines the IETF URN for the EPP namespace. // https://www.iana.org/assignments/xml-registry/ns/epp-1.0.txt EPP = `urn:ietf:params:xml:ns:epp-1.0` // EPPCommon defines the IETF URN for the EPP Common namespace. // https://www.iana.org/assignments/xml-registry/ns/eppcom-1.0.txt EPPCommon = `urn:ietf:params:xml:ns:eppcom-1.0` )
Variables ¶
var ( // True is a Bool of value true. True = Bool(true) // False is a Bool of value false. False = Bool(false) )
var DebugLogger io.Writer
DebugLogger is an io.Writer. Set to enable logging of EPP message XML.
var ExtURNNames = map[string]string{ "secDNS-1.1": ExtSecDNS, "rgp-1.0": ExtRGP, "launch-1.0": ExtLaunch, "idn-1.0": ExtIDN, "charge-1.0": ExtCharge, "fee-0.5": ExtFee05, "fee-0.6": ExtFee06, "fee-0.7": ExtFee07, "fee-0.8": ExtFee08, "fee-0.9": ExtFee09, "fee-0.11": ExtFee11, "fee-0.21": ExtFee21, "fee-1.0": ExtFee10, "price-1.1": ExtPrice, "namestoreExt-1.1": ExtNamestore, "neulevel": ExtNeulevel, "neulevel-1.0": ExtNeulevel10, }
ExtURNNames maps short extension names to their full URN.
Functions ¶
Types ¶
type Bool ¶
type Bool bool
Bool represents a bool that can be serialized to XML. True: <tag> False: (no tag)
func (Bool) MarshalXML ¶
MarshalXML impements the xml.Marshaler interface. Any tag present with this type = true.
func (Bool) MarshalXMLAttr ¶
MarshalXMLAttr implements the xml.MarshalerAttr interface. Attributes will be serialized with a value of "0" or "1".
func (*Bool) UnmarshalXML ¶
UnmarshalXML impements the xml.Unmarshaler interface. Any tag present with this type = true.
type Conn ¶
type Conn struct { // Conn is the underlying net.Conn (usually a TLS connection). net.Conn // Timeout defines the timeout for network operations. // It must be set at initialization. Changing it after // a connection is already opened will have no effect. Timeout time.Duration // Greeting holds the last received greeting message from the server, // indicating server name, status, data policy and capabilities. // // Deprecated: This field is written to upon opening a new EPP connection and should not be modified. Greeting // LoginResult holds the last received login response message's Result // from the server, in which some servers might include diagnostics such // as connection count limits. // // Deprecated: this field is written to by the Login method but otherwise is not used by this package. LoginResult Result // contains filtered or unexported fields }
Conn represents a single connection to an EPP server. Reads and writes are serialized, so it is safe for concurrent use.
func NewConn ¶
NewConn initializes an epp.Conn from a net.Conn and performs the EPP handshake. It reads and stores the initial EPP <greeting> message. https://tools.ietf.org/html/rfc5730#section-2.4
func NewTimeoutConn ¶
NewTimeoutConn initializes an epp.Conn like NewConn, limiting the duration of network operations on conn using Set(Read|Write)Deadline.
func (*Conn) CheckDomain ¶
func (c *Conn) CheckDomain(domains ...string) (*DomainCheckResponse, error)
CheckDomain queries the EPP server for the availability status of one or more domains.
func (*Conn) CheckDomainExtensions ¶
func (c *Conn) CheckDomainExtensions(domains []string, extData map[string]string) (*DomainCheckResponse, error)
CheckDomainExtensions allows specifying extension data for the following:
- "neulevel:unspec": a string of the Key=Value data for the unspec tag
- "launch:phase": a string of the launch phase
func (*Conn) DomainInfo ¶
DomainInfo retrieves info for a domain. https://tools.ietf.org/html/rfc5731#section-3.1.2
func (*Conn) Login ¶
Login initializes an authenticated EPP session. https://tools.ietf.org/html/rfc5730#section-2.9.1.1
func (*Conn) Logout ¶
Logout sends a <logout> command to terminate an EPP session. https://tools.ietf.org/html/rfc5730#section-2.9.1.2
func (*Conn) ReadRawResponse ¶
readRawResponse dequeues and returns a raw EPP response frame from Conn
type DomainCharge ¶
DomainCharge represents various EPP charge and fee extension data. FIXME: unpack into multiple types for different extensions.
type DomainCheck ¶
DomainCheck represents an EPP <chkData> and associated extension data.
type DomainCheckResponse ¶
type DomainCheckResponse struct { Domain string Checks []DomainCheck Charges []DomainCharge }
DomainCheckResponse represents an EPP <response> for a domain check.
type DomainInfoResponse ¶
type DomainInfoResponse struct { Domain string // <domain:name> ID string // <domain:roid> ClID string // <domain:clID> UpID string // <domain:upID> CrDate time.Time // <domain:crDate> ExDate time.Time // <domain:exDate> UpDate time.Time // <domain:upDate> TrDate time.Time // <domain:trDate> Status []string // <domain:status> }
DomainInfoResponse represents an EPP response for a domain info request. https://tools.ietf.org/html/rfc5731#section-3.1.2
type Greeting ¶
type Greeting struct { ServerName string `xml:"svID"` Versions []string `xml:"svcMenu>version"` Languages []string `xml:"svcMenu>lang"` Objects []string `xml:"svcMenu>objURI"` Extensions []string `xml:"svcMenu>svcExtension>extURI,omitempty"` }
Greeting is an EPP response that represents server status and capabilities. https://tools.ietf.org/html/rfc5730#section-2.4
func (*Greeting) SupportsExtension ¶
SupportsExtension returns true if the EPP server supports the extension specified by uri.
func (*Greeting) SupportsObject ¶
SupportsObject returns true if the EPP server supports the object specified by uri.
type Response ¶
type Response struct { Result Greeting DomainCheckResponse DomainInfoResponse }
Response represents an EPP response.
type Result ¶
type Result struct { Code int `xml:"code,attr"` Message string `xml:"msg"` Reason string `xml:"extValue>reason,omitempty"` }
Result represents an EPP <result> element.
func (*Result) IsError ¶
IsError determines whether an EPP status code is an error. https://tools.ietf.org/html/rfc5730#section-3
func (*Result) IsFatal ¶
IsFatal determines whether an EPP status code is a fatal response, and the connection should be closed. https://tools.ietf.org/html/rfc5730#section-3
type Status ¶
type Status uint32
Status represents EPP status codes as a bitfield. https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en https://tools.ietf.org/html/std69 https://tools.ietf.org/html/rfc3915
const ( StatusUnknown Status = iota // Server status codes set by a domain registry StatusOK Status = 1 << (iota - 1) // Standard status for a domain, meaning it has no pending operations or prohibitions. StatusLinked StatusAddPeriod // This grace period is provided after the initial registration of a domain name. If the registrar deletes the domain name during this period, the registry may provide credit to the registrar for the cost of the registration. StatusAutoRenewPeriod StatusInactive StatusPendingCreate StatusPendingDelete StatusPendingRenew StatusPendingRestore StatusPendingTransfer StatusPendingUpdate StatusRedemptionPeriod StatusRenewPeriod StatusServerDeleteProhibited StatusServerHold StatusServerRenewProhibited StatusServerTransferProhibited StatusServerUpdateProhibited StatusTransferPeriod StatusClientDeleteProhibited StatusClientHold StatusClientRenewProhibited StatusClientTransferProhibited StatusClientUpdateProhibited // RDAP status codes map roughly, but not exactly to EPP status codes. // https://tools.ietf.org/html/rfc8056#section-2 StatusActive = StatusOK StatusAssociated = StatusLinked // StatusClient are status codes set by a domain registrar. StatusClient = StatusClientDeleteProhibited | StatusClientHold | StatusClientRenewProhibited | StatusClientTransferProhibited | StatusClientUpdateProhibited )
Status types, in order of priority, low to high. Status are stored in a single integer as a bit field.
func ParseStatus ¶
ParseStatus returns a Status from one or more strings. It does not attempt to validate the input or resolve conflicting status bits.
type Time ¶
Time represents EPP date-time values, serialized to XML in RFC-3339 format. Because the default encoding.TextMarshaler implementation in time.Time uses RFC-3339, we don’t need to create a custom marshaler for this type.
func (*Time) UnmarshalXML ¶
UnmarshalXML implements a custom XML unmarshaler that ignores time parsing errors. http://stackoverflow.com/a/25015260