diff --git a/integrationTest/integration_test.go b/integrationTest/integration_test.go index c0fc183d99..1e3e9a5d13 100644 --- a/integrationTest/integration_test.go +++ b/integrationTest/integration_test.go @@ -538,8 +538,8 @@ func makeRec2(typ string) *models.RecordConfig { } func a(name string, a string) *models.RecordConfig { - rc := makeRec2("A") - if err := models.FromRaw(rc, "**current-domain**", "A", []string{name, a}, nil); err != nil { + rc, err := models.NewFromRawA([]string{name, a}, nil, "**current-domain**", 300) + if err != nil { panic(err) } return rc diff --git a/models/cloudflare_types.go b/models/cloudflare_types.go index 5bda20cabc..a377c5623d 100644 --- a/models/cloudflare_types.go +++ b/models/cloudflare_types.go @@ -35,8 +35,8 @@ type CFSINGLEREDIRECT struct { SRDisplay string `dns:"skip" json:"sr_display,omitempty"` // How is this displayed to the user (SetTarget) for CF_SINGLE_REDIRECT } -func NewFromRawCFSINGLEREDIRECT(rawfields []string, meta map[string]string, origin string) (*RecordConfig, error) { - rc := &RecordConfig{} +func NewFromRawCFSINGLEREDIRECT(rawfields []string, meta map[string]string, origin string, ttl uint32) (*RecordConfig, error) { + rc := &RecordConfig{TTL: ttl} if err := PopulateFromRawCFSINGLEREDIRECT(rc, rawfields, meta, origin); err != nil { return nil, err } diff --git a/models/types.go b/models/types.go index 376e854a12..766b49903e 100644 --- a/models/types.go +++ b/models/types.go @@ -40,8 +40,8 @@ type A struct { } // NewFromRawA creates a new RecordConfig of type A from rawfields, meta, and origin. -func NewFromRawA(rawfields []string, meta map[string]string, origin string) (*RecordConfig, error) { - rc := &RecordConfig{} +func NewFromRawA(rawfields []string, meta map[string]string, origin string, ttl uint32) (*RecordConfig, error) { + rc := &RecordConfig{TTL: ttl} if err := PopulateFromRawA(rc, rawfields, meta, origin); err != nil { return nil, err } @@ -136,8 +136,8 @@ type MX struct { } // NewFromRawMX creates a new RecordConfig of type MX from rawfields, meta, and origin. -func NewFromRawMX(rawfields []string, meta map[string]string, origin string) (*RecordConfig, error) { - rc := &RecordConfig{} +func NewFromRawMX(rawfields []string, meta map[string]string, origin string, ttl uint32) (*RecordConfig, error) { + rc := &RecordConfig{TTL: ttl} if err := PopulateFromRawMX(rc, rawfields, meta, origin); err != nil { return nil, err } @@ -246,8 +246,8 @@ type SRV struct { } // NewFromRawSRV creates a new RecordConfig of type SRV from rawfields, meta, and origin. -func NewFromRawSRV(rawfields []string, meta map[string]string, origin string) (*RecordConfig, error) { - rc := &RecordConfig{} +func NewFromRawSRV(rawfields []string, meta map[string]string, origin string, ttl uint32) (*RecordConfig, error) { + rc := &RecordConfig{TTL: ttl} if err := PopulateFromRawSRV(rc, rawfields, meta, origin); err != nil { return nil, err }