dnscontrol/pkg/js/static.go
Brice Figureau 7b8d608019 ROUTE53: Support Route53's ALIAS record type (#239) (#301)
* Stable comparison of metadata (#239)

Iterating over a map in Go never produces twice the same ordering.
Thus when comparing two metadata map with more than one key, the
`differ` is always finding differences.

To properly compare records metadata, we need to iterate the maps
in a deterministic way.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>

* Support for Route53 ALIAS record type (#239)

Route53 ALIAS doesn't behave like a regular ALIAS, and is much more
limited as its target can only be some specific AWS resources or
another record in the same zone.

According to #239, this change adds a new directive R53_ALIAS which
implements this specific alias. This record type can only be used
with the Route53 provider.

This directive usage looks like this:
```js
D("example.com", REGISTRAR, DnsProvider("ROUTE53"),
R53_ALIAS("foo1", "A", "bar") // record in same zone
R53_ALIAS("foo2", "A",
  "blahblah.elasticloadbalancing.us-west-1.amazonaws.com",
   R53_ZONE('Z368ELLRRE2KJ0')) // ELB in us-west-1

```

Unfortunately, Route53 requires indicating the hosted zone id
where the target is defined (those are listed in AWS documentation,
see the R53_ALIAS documentation for links).
2018-01-16 05:53:12 -05:00

289 lines
10 KiB
Go

// Code generated by "esc "; DO NOT EDIT.
package js
import (
"bytes"
"compress/gzip"
"encoding/base64"
"io/ioutil"
"net/http"
"os"
"path"
"sync"
"time"
)
type _escLocalFS struct{}
var _escLocal _escLocalFS
type _escStaticFS struct{}
var _escStatic _escStaticFS
type _escDirectory struct {
fs http.FileSystem
name string
}
type _escFile struct {
compressed string
size int64
modtime int64
local string
isDir bool
once sync.Once
data []byte
name string
}
func (_escLocalFS) Open(name string) (http.File, error) {
f, present := _escData[path.Clean(name)]
if !present {
return nil, os.ErrNotExist
}
return os.Open(f.local)
}
func (_escStaticFS) prepare(name string) (*_escFile, error) {
f, present := _escData[path.Clean(name)]
if !present {
return nil, os.ErrNotExist
}
var err error
f.once.Do(func() {
f.name = path.Base(name)
if f.size == 0 {
return
}
var gr *gzip.Reader
b64 := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(f.compressed))
gr, err = gzip.NewReader(b64)
if err != nil {
return
}
f.data, err = ioutil.ReadAll(gr)
})
if err != nil {
return nil, err
}
return f, nil
}
func (fs _escStaticFS) Open(name string) (http.File, error) {
f, err := fs.prepare(name)
if err != nil {
return nil, err
}
return f.File()
}
func (dir _escDirectory) Open(name string) (http.File, error) {
return dir.fs.Open(dir.name + name)
}
func (f *_escFile) File() (http.File, error) {
type httpFile struct {
*bytes.Reader
*_escFile
}
return &httpFile{
Reader: bytes.NewReader(f.data),
_escFile: f,
}, nil
}
func (f *_escFile) Close() error {
return nil
}
func (f *_escFile) Readdir(count int) ([]os.FileInfo, error) {
return nil, nil
}
func (f *_escFile) Stat() (os.FileInfo, error) {
return f, nil
}
func (f *_escFile) Name() string {
return f.name
}
func (f *_escFile) Size() int64 {
return f.size
}
func (f *_escFile) Mode() os.FileMode {
return 0
}
func (f *_escFile) ModTime() time.Time {
return time.Unix(f.modtime, 0)
}
func (f *_escFile) IsDir() bool {
return f.isDir
}
func (f *_escFile) Sys() interface{} {
return f
}
// _escFS returns a http.Filesystem for the embedded assets. If useLocal is true,
// the filesystem's contents are instead used.
func _escFS(useLocal bool) http.FileSystem {
if useLocal {
return _escLocal
}
return _escStatic
}
// _escDir returns a http.Filesystem for the embedded assets on a given prefix dir.
// If useLocal is true, the filesystem's contents are instead used.
func _escDir(useLocal bool, name string) http.FileSystem {
if useLocal {
return _escDirectory{fs: _escLocal, name: name}
}
return _escDirectory{fs: _escStatic, name: name}
}
// _escFSByte returns the named file from the embedded assets. If useLocal is
// true, the filesystem's contents are instead used.
func _escFSByte(useLocal bool, name string) ([]byte, error) {
if useLocal {
f, err := _escLocal.Open(name)
if err != nil {
return nil, err
}
b, err := ioutil.ReadAll(f)
_ = f.Close()
return b, err
}
f, err := _escStatic.prepare(name)
if err != nil {
return nil, err
}
return f.data, nil
}
// _escFSMustByte is the same as _escFSByte, but panics if name is not present.
func _escFSMustByte(useLocal bool, name string) []byte {
b, err := _escFSByte(useLocal, name)
if err != nil {
panic(err)
}
return b
}
// _escFSString is the string version of _escFSByte.
func _escFSString(useLocal bool, name string) (string, error) {
b, err := _escFSByte(useLocal, name)
return string(b), err
}
// _escFSMustString is the string version of _escFSMustByte.
func _escFSMustString(useLocal bool, name string) string {
return string(_escFSMustByte(useLocal, name))
}
var _escData = map[string]*_escFile{
"/helpers.js": {
local: "pkg/js/helpers.js",
size: 18525,
modtime: 0,
compressed: `
H4sIAAAAAAAC/+x863PjNpL4d/8VnanfhuKYQ7/i2S052t8qfuRc8atkTXb2dDoVTEISxhTJA0BpnMTz
t1/hRQJ8yE4qyX65fBiLQKPR3Wh0NxqNeAXDwDglEfdOdnbWiEKUpXMYwM87AAAULwjjFFHWh8k0kG1x
ymY5zdYkxk5ztkIkbTTMUrTCuvVZTxHjOSoSPqQLBgOYTE92duZFGnGSpUBSwglKyE+452siHIq6qNpC
WSt1zyeKyAYpzxYxN3gzMnP1BCMB8KccB7DCHBnyyBx6otW3KBTfMBiAdz28+TC88tRkz/JfIQGKF4Ij
EDj7UGHuW/j78l9DqBBCWDEe5gVb9ihe+Cd6oXhBU4mpwcJZyu60VF5kIpurWQeC+OzhE464B19/DR7J
Z1GWrjFlJEuZByR1xov/xHfowsEA5hldIT7jvNfS79cFE7P8twjGWXklm5jlL8kmxZszqRdaLKV4/VL9
5ciKRYuspjb2q5+BI5Q+/Pxsw0cZjZuqe1dprg2uNXQ8vurDfuBQwjBdNzSdLNKM4niWoAecuApv857T
LMKMnSG6YL1VoDeIYXxvT6wbYBQtYZXFZE4wDYSSEA6EAQrDsITTGPsQoSQRABvClxqfAUKUoqe+mVSI
oKCMrHHyZCCUromlpQssp0l5JqUXI45KHZ2FhF3oGXsr31G/nuZB6xTghOFy0FBQUBshWOwJrfsk1dnu
Ev+5Ipp8mpZSOinhntvmupW81Cabhfgzx2msqQwFawGsXGotC7Kk2Qa8fw5HN5c33/f1zOViKAtTpKzI
84xyHPfBg12HfLOda80eKJ1vDtCEqX2imHve2dnbgzO1P6rt0YdTih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