external-dns/registry/registry.go
Yerken 9a44453d59 define registry interface (#120)
* define registry interface

* init in-memory registry

* remove ununsed variable, added comments

* add inmemory registry tests

* introduce DNSRecord struct

* use noop registry

* remove zone from registry fields

* replace provider with registry in controller

* move noop registry interface check to test

* remove ownerid from noop registry

* fix: remove dangling empty line

* return provider records directly with noop

* adjust according to pr review

* fix noop tests
2017-04-07 16:00:24 +02:00

32 lines
1.2 KiB
Go

/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package registry
import (
"github.com/kubernetes-incubator/external-dns/endpoint"
"github.com/kubernetes-incubator/external-dns/plan"
)
// Registry is an interface which should enables ownership concept in external-dns
// Record(zone string) returns ALL records registered with DNS provider (TODO: for multi-zone support return all records)
// each entry includes owner information
// ApplyChanges(zone string, changes *plan.Changes) propagates the changes to the DNS Provider API and correspondingly updates ownership depending on type of registry being used
type Registry interface {
Records(zone string) ([]*endpoint.Endpoint, error)
ApplyChanges(zone string, changes *plan.Changes) error
}