Skip to content

Commit

Permalink
Add TTL property to Domains
Browse files Browse the repository at this point in the history
  • Loading branch information
xmudrii committed Apr 25, 2017
1 parent c21ba08 commit b7a390c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type DomainRecord struct {
Data string `json:"data,omitempty"`
Priority int `json:"priority,omitempty"`
Port int `json:"port,omitempty"`
TTL int `json:"ttl,omitempty"`
Weight int `json:"weight,omitempty"`
}

Expand All @@ -84,6 +85,7 @@ type DomainRecordEditRequest struct {
Data string `json:"data,omitempty"`
Priority int `json:"priority,omitempty"`
Port int `json:"port,omitempty"`
TTL int `json:"ttl,omitempty"`
Weight int `json:"weight,omitempty"`
}

Expand Down
8 changes: 6 additions & 2 deletions domains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func TestDomains_CreateRecordForDomainName(t *testing.T) {
Data: "@",
Priority: 10,
Port: 10,
TTL: 1800,
Weight: 10,
}

Expand Down Expand Up @@ -275,6 +276,7 @@ func TestDomains_EditRecordForDomainName(t *testing.T) {
Data: "@",
Priority: 10,
Port: 10,
TTL: 1800,
Weight: 10,
}

Expand Down Expand Up @@ -312,11 +314,12 @@ func TestDomainRecord_String(t *testing.T) {
Data: "@",
Priority: 10,
Port: 10,
TTL: 1800,
Weight: 10,
}

stringified := record.String()
expected := `godo.DomainRecord{ID:1, Type:"CNAME", Name:"example", Data:"@", Priority:10, Port:10, Weight:10}`
expected := `godo.DomainRecord{ID:1, Type:"CNAME", Name:"example", Data:"@", Priority:10, Port:10, TTL:1800, Weight:10}`
if expected != stringified {
t.Errorf("DomainRecord.String returned %+v, expected %+v", stringified, expected)
}
Expand All @@ -329,11 +332,12 @@ func TestDomainRecordEditRequest_String(t *testing.T) {
Data: "@",
Priority: 10,
Port: 10,
TTL: 1800,
Weight: 10,
}

stringified := record.String()
expected := `godo.DomainRecordEditRequest{Type:"CNAME", Name:"example", Data:"@", Priority:10, Port:10, Weight:10}`
expected := `godo.DomainRecordEditRequest{Type:"CNAME", Name:"example", Data:"@", Priority:10, Port:10, TTL:1800, Weight:10}`
if expected != stringified {
t.Errorf("DomainRecordEditRequest.String returned %+v, expected %+v", stringified, expected)
}
Expand Down

0 comments on commit b7a390c

Please sign in to comment.