1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Cloudflare Redirects (#119)

* function sig

* sig

* some custom record infrastructure

* CLOUDFLARE REDIRECTS!

* comments out

* guarding redirects behind provider metadata to manage

* catch commas in js to ensure proper encoding.

* gen

* small fix

* revendor otto

* docs
This commit is contained in:
Craig Peterson
2017-05-19 14:15:57 -04:00
committed by GitHub
parent a355b8e438
commit f1a0d65198
18 changed files with 471 additions and 99 deletions

View File

@@ -138,3 +138,24 @@ func init() {
return None{}, nil
})
}
type CustomRType struct {
Name string
Provider string
RealType string
}
// RegisterCustomRecordType registers a record type that is only valid for one provider.
// provider is the registered type of provider this is valid with
// name is the record type as it will appear in the js. (should be something like $PROVIDER_FOO)
// realType is the record type it will be replaced with after validation
func RegisterCustomRecordType(name, provider, realType string) {
customRecordTypes[name] = &CustomRType{Name: name, Provider: provider, RealType: realType}
}
// GetCustomRecordType returns a registered custom record type, or nil if none
func GetCustomRecordType(rType string) *CustomRType {
return customRecordTypes[rType]
}
var customRecordTypes = map[string]*CustomRType{}