Skip to content

parrotmac/go-namecheap-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Namecheap SDK

Go Reference

Getting

$ go get github.com/namecheap/go-namecheap-sdk/v2/namecheap

Usage

import (
    "context"

    "github.com/namecheap/go-namecheap-sdk/v2/namecheap"
)

client := namecheap.NewClient(&namecheap.ClientOptions{
    UserName:   "UserName",
    ApiUser:    "ApiUser",
    ApiKey:     "ApiKey",
    ClientIp:   "10.10.10.10",
    UseSandbox: false,
})

setHostsResp, err := client.DomainsDNS.SetHosts(context.TODO(), &namecheap.DomainsDNSSetHostsArgs{
    Domain: "domain.com",
    Records: &[]namecheap.DomainsDNSHostRecord{
        {
            HostName:   "blog",
            RecordType: "A",
            Address:    "11.12.13.14",
        },
    },
})

// ...

response, err := client.DomainsDNS.GetHosts(context.TODO(), "domain.com")

// ...

Examples

Examples are available under the examples/ directory.

Sandbox

Before you start using our API, we advise you to try it in our Sandbox environment. The sandbox environment was created explicitly for testing purposes. All purchases processed through the sandbox API are simulated.

To start testing API in Sandbox, you will need to sign up for an account here (this account will not be associated with the one you have at http://www.namecheap.com).

Contributing

To contribute, please read our contributing docs.

About

Go library for Namecheap API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.8%
  • Makefile 0.2%