Code Monkey home page Code Monkey logo

go-namecheap's Introduction

go-namecheap

A Go library for using the Namecheap API.

Build Status: Build Status

Examples

package main
import (
  "fmt"
  namecheap "github.com/billputer/go-namecheap"
)

func main() {
  apiUser := "billwiens"
  apiToken := "xxxxxxx"
  userName := "billwiens"

  client := namecheap.NewClient(apiUser, apiToken, userName)

  // Get a list of your domains
  domains, _ := client.DomainsGetList()
  for _, domain := range domains {
    fmt.Printf("Domain: %+v\n\n", domain.Name)
  }

}

For more complete documentation, load up godoc and find the package.

Development

Pull requests welcome!

Attribution

Most concepts and code borrowed from the excellent go-dnsimple.

go-namecheap's People

Contributors

billputer avatar dirkaholic avatar golint-fixer avatar jameshartig avatar phpfs avatar r-medina avatar rbelnap avatar rodrigosaito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-namecheap's Issues

All endpoints should probably just make POST requests

After playing with the api in postman for a bit, I have discovered that ALL endpoints work fine if you make an http POST request and provide all data in x-www-form-urlencoded format instead of query parameters.

In all of my testing, all endpoints have worked fine, although query parameters will take priority over post body ones.

This is necessary for things like setHosts, where there can be a ton of data that won't fit reliably in a url string.

I propose making all calls over http post and using http form encoding instead of query strings. Hopefully that will ease some of the odd encoding/escaping behavior we have to work around too, but I wouldn't count on it.

I'm working on a pr to this effect now.

DomainCheckResult for premium domains

As described by Namecheap, a domain check may return special pricing for premium domains.
https://www.namecheap.com/support/api/methods/domains/check.aspx

To implement this, we could add DomainCheckResult.IsPremiumName,.PremiumRegistrationPrice,.PremiumRenewalPrice,.PremiumRestorePrice,. PremiumTransferPrice,.IcannFee as returned by the API. (They are all just null for normal domains!)

type DomainCheckResult struct {
    Domain string
    Available bool
    IsPremiumName bool
    PremiumRegistrationPrice float32
    PremiumRenewalPrice float32
    PremiumRestorePrice float32
    PremiumTransferPrice float32
    IcannFee float32
}

I will take a look at implementing this when I have time :)

@billputer Thank you for go-namecheap!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.