Skip to content

Commit 50e30ab

Browse files
committed
- Make examples work again
- Have DomainService.DomainNames() retun []string
1 parent 5875579 commit 50e30ab

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

README.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ package main
2222

2323
import (
2424
"github.com/mpdroog/transip"
25-
"github.com/mpdroog/transip/creds"
2625
"fmt"
2726
)
2827

2928
func printDomainInfo(username, privKeyPath string) error {
30-
creds := creds.Client{
29+
creds := transip.Client{
3130
Login: username,
3231
ReadWrite: false,
3332
}
@@ -42,7 +41,7 @@ func printDomainInfo(username, privKeyPath string) error {
4241
return err
4342
}
4443
fmt.Printf("\t%+v\n\n", domain)
45-
return nil
44+
return nil
4645
}
4746
```
4847

@@ -52,12 +51,11 @@ package main
5251

5352
import (
5453
"github.com/mpdroog/transip"
55-
"github.com/mpdroog/transip/creds"
5654
"fmt"
5755
)
5856

5957
func printDomainNames(username, privKeyPath string) error {
60-
creds := creds.Client{
58+
creds := transip.Client{
6159
Login: username,
6260
ReadWrite: false,
6361
}
@@ -71,7 +69,7 @@ func printDomainNames(username, privKeyPath string) error {
7169
if err != nil {
7270
return err
7371
}
74-
domains, err := domainService.Domains(domainNames.Item)
72+
domains, err := domainService.Domains(domainNames)
7573
if err != nil {
7674
return err
7775
}
@@ -91,13 +89,11 @@ package main
9189

9290
import (
9391
"github.com/mpdroog/transip"
94-
"github.com/mpdroog/transip/creds"
95-
"github.com/mpdroog/transip/soap"
9692
"fmt"
9793
)
9894

9995
func overWriteDnsEntries(username, privKeyPath, domain string) error {
100-
creds := creds.Client{
96+
creds := transip.Client{
10197
Login: username,
10298
ReadWrite: false,
10399
}
@@ -107,7 +103,7 @@ func overWriteDnsEntries(username, privKeyPath, domain string) error {
107103
}
108104

109105
// 360 = 6min (TTL in seconds)
110-
recordSet := []soap.DomainDNSentry{
106+
recordSet := []transip.DomainDNSentry{
111107
{Name: "@", Expire: 360, Type: "A", Content: "127.0.0.1"},
112108
}
113109

domainservice.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ type DomainService struct {
1313
Creds Client
1414
}
1515

16-
func (c *DomainService) DomainNames() (*DomainNames, error) {
16+
func (c *DomainService) DomainNames() ([]string, error) {
1717
rawbody, e := Lookup(c.Creds, Request{Service: domainService, Method: "getDomainNames", Body: `<ns1:getDomainNames/>`})
1818
if e != nil {
1919
return nil, e
2020
}
2121

2222
domains := &DomainNames{}
2323
e = Decode(rawbody, &domains)
24-
return domains, e
24+
return domains.Item, e
2525
}
2626

2727
func (c *DomainService) Domain(name string) (*Domain, error) {

0 commit comments

Comments
 (0)