{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/comments/104392281","pull_request_review_id":25226396,"id":104392281,"diff_hunk":"@@ -0,0 +1,157 @@\n+/*\n+Copyright 2017 The Kubernetes Authors.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package dnsprovider\n+\n+import (\n+\t\"errors\"\n+\n+\t\"github.com/kubernetes-incubator/external-dns/endpoint\"\n+\t\"github.com/kubernetes-incubator/external-dns/plan\"\n+)\n+\n+var (\n+\tdefaultType = \"A\"\n+\n+\t// ErrZoneNotFound error returned when specified zone does not exists\n+\tErrZoneNotFound = errors.New(\"specified zone not found\")\n+\t// ErrRecordAlreadyExists when create request is sent but record already exists\n+\tErrRecordAlreadyExists = errors.New(\"record already exists\")\n+\t// ErrRecordNotFound when update/delete request is sent but record not found\n+\tErrRecordNotFound = errors.New(\"record not found\")\n+\t// ErrInvalidBatchRequest when record is repeated in create/update/delete\n+\tErrInvalidBatchRequest = errors.New(\"record should only be specified in one list\")\n+)\n+\n+type zone map[string][]*InMemoryRecord\n+\n+// InMemory - dns provider only used for testing purposes\n+// initialized as dns provider with no records\n+type InMemory struct {\n+\tzones map[string]zone\n+}\n+\n+// NewInMemory returns InMemory DNS provider interface\n+func NewInMemory() *InMemory {\n+\treturn &InMemory{\n+\t\tzones: map[string]zone{},\n+\t}\n+}\n+\n+// InMemoryRecord - record stored in memory\n+// has additional fields:\n+// Type - type of string (TODO: Type should probably be part of endpoint struct)","path":"dnsprovider/inmemory.go","position":56,"original_position":56,"commit_id":"3c9c2abad4ae92a6eda017c71b7c6bb1b4cd5e74","original_commit_id":"3c9c2abad4ae92a6eda017c71b7c6bb1b4cd5e74","user":{"login":"linki","id":36162,"avatar_url":"https://avatars2.githubusercontent.com/u/36162?v=3","gravatar_id":"","url":"https://api.github.com/users/linki","html_url":"https://github.com/linki","followers_url":"https://api.github.com/users/linki/followers","following_url":"https://api.github.com/users/linki/following{/other_user}","gists_url":"https://api.github.com/users/linki/gists{/gist_id}","starred_url":"https://api.github.com/users/linki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linki/subscriptions","organizations_url":"https://api.github.com/users/linki/orgs","repos_url":"https://api.github.com/users/linki/repos","events_url":"https://api.github.com/users/linki/events{/privacy}","received_events_url":"https://api.github.com/users/linki/received_events","type":"User","site_admin":false},"body":"Since `InMemoryRecord` is an implementation detail of `InMemoryProvider` I'm fine with having a separate `struct`. 👍 ","created_at":"2017-03-06T11:20:41Z","updated_at":"2017-03-06T11:20:41Z","html_url":"https://github.com/kubernetes-incubator/external-dns/pull/59#discussion_r104392281","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/comments/104392281"},"html":{"href":"https://github.com/kubernetes-incubator/external-dns/pull/59#discussion_r104392281"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59","id":109236241,"html_url":"https://github.com/kubernetes-incubator/external-dns/pull/59","diff_url":"https://github.com/kubernetes-incubator/external-dns/pull/59.diff","patch_url":"https://github.com/kubernetes-incubator/external-dns/pull/59.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/59","number":59,"state":"open","locked":false,"title":"in-memory dnsprovider implementation without tests","user":{"login":"ideahitme","id":23239537,"avatar_url":"https://avatars3.githubusercontent.com/u/23239537?v=3","gravatar_id":"","url":"https://api.github.com/users/ideahitme","html_url":"https://github.com/ideahitme","followers_url":"https://api.github.com/users/ideahitme/followers","following_url":"https://api.github.com/users/ideahitme/following{/other_user}","gists_url":"https://api.github.com/users/ideahitme/gists{/gist_id}","starred_url":"https://api.github.com/users/ideahitme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideahitme/subscriptions","organizations_url":"https://api.github.com/users/ideahitme/orgs","repos_url":"https://api.github.com/users/ideahitme/repos","events_url":"https://api.github.com/users/ideahitme/events{/privacy}","received_events_url":"https://api.github.com/users/ideahitme/received_events","type":"User","site_admin":false},"body":"/cc @linki @iterion @justinsb \r\n\r\nThis is in-memory dns provider which should help us to test other components. \r\n\r\nIt implements the dnsprovider interface and provides ApplyChanges batch processing with validations. Also supports multiple records per dns name (given different record types), this is for implementing storage via TXT records ","created_at":"2017-03-06T11:11:54Z","updated_at":"2017-03-06T11:20:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d05752dfa0773570e8aece44ed401ea1d20e4b98","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59/comments","review_comment_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/59/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/statuses/3c9c2abad4ae92a6eda017c71b7c6bb1b4cd5e74","head":{"label":"kubernetes-incubator:dnsprovider/in-memory","ref":"dnsprovider/in-memory","sha":"3c9c2abad4ae92a6eda017c71b7c6bb1b4cd5e74","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars1.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":81497153,"name":"external-dns","full_name":"kubernetes-incubator/external-dns","owner":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars1.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-incubator/external-dns","description":null,"fork":false,"url":"https://api.github.com/repos/kubernetes-incubator/external-dns","forks_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/forks","keys_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/teams","hooks_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/events","assignees_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/tags","blobs_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/languages","stargazers_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/subscription","commits_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/merges","archive_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/downloads","issues_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/deployments","created_at":"2017-02-09T21:34:27Z","updated_at":"2017-03-06T06:13:54Z","pushed_at":"2017-03-06T11:11:55Z","git_url":"git://github.com/kubernetes-incubator/external-dns.git","ssh_url":"git@github.com:kubernetes-incubator/external-dns.git","clone_url":"https://github.com/kubernetes-incubator/external-dns.git","svn_url":"https://github.com/kubernetes-incubator/external-dns","homepage":null,"size":15577,"stargazers_count":46,"watchers_count":46,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":27,"forks":3,"open_issues":27,"watchers":46,"default_branch":"master"}},"base":{"label":"kubernetes-incubator:master","ref":"master","sha":"b0a9476aa5a44d9e3d4a15122bc5fbe332197b19","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars1.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":81497153,"name":"external-dns","full_name":"kubernetes-incubator/external-dns","owner":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars1.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-incubator/external-dns","description":null,"fork":false,"url":"https://api.github.com/repos/kubernetes-incubator/external-dns","forks_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/forks","keys_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/teams","hooks_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/events","assignees_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/tags","blobs_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/languages","stargazers_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/subscription","commits_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/merges","archive_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/downloads","issues_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-incubator/external-dns/deployments","created_at":"2017-02-09T21:34:27Z","updated_at":"2017-03-06T06:13:54Z","pushed_at":"2017-03-06T11:11:55Z","git_url":"git://github.com/kubernetes-incubator/external-dns.git","ssh_url":"git@github.com:kubernetes-incubator/external-dns.git","clone_url":"https://github.com/kubernetes-incubator/external-dns.git","svn_url":"https://github.com/kubernetes-incubator/external-dns","homepage":null,"size":15577,"stargazers_count":46,"watchers_count":46,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":27,"forks":3,"open_issues":27,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59"},"html":{"href":"https://github.com/kubernetes-incubator/external-dns/pull/59"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/59"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/external-dns/statuses/3c9c2abad4ae92a6eda017c71b7c6bb1b4cd5e74"}}}}
{"actor":{"display_login":"linki"}}