{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/fleet/pulls/comments/23871048","id":23871048,"diff_hunk":"@@ -0,0 +1,72 @@\n+// Copyright 2014 CoreOS, Inc.\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+package lease\n+\n+import \"time\"\n+\n+// Lease proxies to an auto-expiring lease stored in a LeaseRegistry.\n+// The creator of a Lease must repeatedly call Renew to keep their lease\n+// from expiring.\n+type Lease interface {\n+\t// Renew attempts to extend the Lease TTL to the provided duration.\n+\t// The operation will succeed only if the Lease has not changed in\n+\t// the LeaseRegistry since it was last renewed or first acquired.\n+\t// An error is returned if the Lease has already expired, or if the\n+\t// operation fails for any other reason.\n+\tRenew(time.Duration) error\n+\n+\t// Release relinquishes the ownership of a Lease back to the Registry.\n+\t// After calling Release, the Lease object should be discarded. An\n+\t// error is returned if the Lease has already expired, or if the\n+\t// operation fails for any other reason.\n+\tRelease() error\n+\n+\t// MachineID returns the ID of the Machine that holds this Lease. This\n+\t// value must be considered a cached value as it is not guaranteed to\n+\t// be correct.\n+\tMachineID() string\n+\n+\t// Version returns the current version at which the lesse is operating.","path":"pkg/lease/interface.go","position":41,"original_position":41,"commit_id":"ff36ad75813113975cbcc25f3b939b1489a48b74","original_commit_id":"ff36ad75813113975cbcc25f3b939b1489a48b74","user":{"login":"ecnahc515","id":1400401,"avatar_url":"https://avatars.githubusercontent.com/u/1400401?v=3","gravatar_id":"","url":"https://api.github.com/users/ecnahc515","html_url":"https://github.com/ecnahc515","followers_url":"https://api.github.com/users/ecnahc515/followers","following_url":"https://api.github.com/users/ecnahc515/following{/other_user}","gists_url":"https://api.github.com/users/ecnahc515/gists{/gist_id}","starred_url":"https://api.github.com/users/ecnahc515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecnahc515/subscriptions","organizations_url":"https://api.github.com/users/ecnahc515/orgs","repos_url":"https://api.github.com/users/ecnahc515/repos","events_url":"https://api.github.com/users/ecnahc515/events{/privacy}","received_events_url":"https://api.github.com/users/ecnahc515/received_events","type":"User","site_admin":false},"body":"This wasn't written by me, and it seems to be referring to the definition of someone who holds a lease.\r\n@jonboulle ","created_at":"2015-01-30T20:45:08Z","updated_at":"2015-01-30T20:45:08Z","html_url":"https://github.com/coreos/fleet/pull/1097#discussion_r23871048","pull_request_url":"https://api.github.com/repos/coreos/fleet/pulls/1097","_links":{"self":{"href":"https://api.github.com/repos/coreos/fleet/pulls/comments/23871048"},"html":{"href":"https://github.com/coreos/fleet/pull/1097#discussion_r23871048"},"pull_request":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1097"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/fleet/pulls/1097","id":27878571,"html_url":"https://github.com/coreos/fleet/pull/1097","diff_url":"https://github.com/coreos/fleet/pull/1097.diff","patch_url":"https://github.com/coreos/fleet/pull/1097.patch","issue_url":"https://api.github.com/repos/coreos/fleet/issues/1097","number":1097,"state":"open","locked":false,"title":"Refactor lease","user":{"login":"ecnahc515","id":1400401,"avatar_url":"https://avatars.githubusercontent.com/u/1400401?v=3","gravatar_id":"","url":"https://api.github.com/users/ecnahc515","html_url":"https://github.com/ecnahc515","followers_url":"https://api.github.com/users/ecnahc515/followers","following_url":"https://api.github.com/users/ecnahc515/following{/other_user}","gists_url":"https://api.github.com/users/ecnahc515/gists{/gist_id}","starred_url":"https://api.github.com/users/ecnahc515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecnahc515/subscriptions","organizations_url":"https://api.github.com/users/ecnahc515/orgs","repos_url":"https://api.github.com/users/ecnahc515/repos","events_url":"https://api.github.com/users/ecnahc515/events{/privacy}","received_events_url":"https://api.github.com/users/ecnahc515/received_events","type":"User","site_admin":false},"body":"This essentially just moves the lease code out of the registry package, into it's own package, and separates the `EtcdRegistry` from `Leases` since it was actually only the engine which was using leases.\r\n\r\nThe purpose is to make the lease package usable outside of fleet, as it can be very useful in other projects that do scheduling similar to fleet. (Which is what I'm planning on using it for).","created_at":"2015-01-22T21:16:49Z","updated_at":"2015-01-30T20:45:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e73c377c0ac7489d05a42c5441816932aaa984bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/fleet/pulls/1097/commits","review_comments_url":"https://api.github.com/repos/coreos/fleet/pulls/1097/comments","review_comment_url":"https://api.github.com/repos/coreos/fleet/pulls/comments/{number}","comments_url":"https://api.github.com/repos/coreos/fleet/issues/1097/comments","statuses_url":"https://api.github.com/repos/coreos/fleet/statuses/ff36ad75813113975cbcc25f3b939b1489a48b74","head":{"label":"ecnahc515:refactor_lease","ref":"refactor_lease","sha":"ff36ad75813113975cbcc25f3b939b1489a48b74","user":{"login":"ecnahc515","id":1400401,"avatar_url":"https://avatars.githubusercontent.com/u/1400401?v=3","gravatar_id":"","url":"https://api.github.com/users/ecnahc515","html_url":"https://github.com/ecnahc515","followers_url":"https://api.github.com/users/ecnahc515/followers","following_url":"https://api.github.com/users/ecnahc515/following{/other_user}","gists_url":"https://api.github.com/users/ecnahc515/gists{/gist_id}","starred_url":"https://api.github.com/users/ecnahc515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecnahc515/subscriptions","organizations_url":"https://api.github.com/users/ecnahc515/orgs","repos_url":"https://api.github.com/users/ecnahc515/repos","events_url":"https://api.github.com/users/ecnahc515/events{/privacy}","received_events_url":"https://api.github.com/users/ecnahc515/received_events","type":"User","site_admin":false},"repo":{"id":29618487,"name":"fleet","full_name":"ecnahc515/fleet","owner":{"login":"ecnahc515","id":1400401,"avatar_url":"https://avatars.githubusercontent.com/u/1400401?v=3","gravatar_id":"","url":"https://api.github.com/users/ecnahc515","html_url":"https://github.com/ecnahc515","followers_url":"https://api.github.com/users/ecnahc515/followers","following_url":"https://api.github.com/users/ecnahc515/following{/other_user}","gists_url":"https://api.github.com/users/ecnahc515/gists{/gist_id}","starred_url":"https://api.github.com/users/ecnahc515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecnahc515/subscriptions","organizations_url":"https://api.github.com/users/ecnahc515/orgs","repos_url":"https://api.github.com/users/ecnahc515/repos","events_url":"https://api.github.com/users/ecnahc515/events{/privacy}","received_events_url":"https://api.github.com/users/ecnahc515/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ecnahc515/fleet","description":"A Distributed init System","fork":true,"url":"https://api.github.com/repos/ecnahc515/fleet","forks_url":"https://api.github.com/repos/ecnahc515/fleet/forks","keys_url":"https://api.github.com/repos/ecnahc515/fleet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecnahc515/fleet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecnahc515/fleet/teams","hooks_url":"https://api.github.com/repos/ecnahc515/fleet/hooks","issue_events_url":"https://api.github.com/repos/ecnahc515/fleet/issues/events{/number}","events_url":"https://api.github.com/repos/ecnahc515/fleet/events","assignees_url":"https://api.github.com/repos/ecnahc515/fleet/assignees{/user}","branches_url":"https://api.github.com/repos/ecnahc515/fleet/branches{/branch}","tags_url":"https://api.github.com/repos/ecnahc515/fleet/tags","blobs_url":"https://api.github.com/repos/ecnahc515/fleet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecnahc515/fleet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecnahc515/fleet/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecnahc515/fleet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecnahc515/fleet/statuses/{sha}","languages_url":"https://api.github.com/repos/ecnahc515/fleet/languages","stargazers_url":"https://api.github.com/repos/ecnahc515/fleet/stargazers","contributors_url":"https://api.github.com/repos/ecnahc515/fleet/contributors","subscribers_url":"https://api.github.com/repos/ecnahc515/fleet/subscribers","subscription_url":"https://api.github.com/repos/ecnahc515/fleet/subscription","commits_url":"https://api.github.com/repos/ecnahc515/fleet/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecnahc515/fleet/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecnahc515/fleet/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecnahc515/fleet/issues/comments/{number}","contents_url":"https://api.github.com/repos/ecnahc515/fleet/contents/{+path}","compare_url":"https://api.github.com/repos/ecnahc515/fleet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecnahc515/fleet/merges","archive_url":"https://api.github.com/repos/ecnahc515/fleet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecnahc515/fleet/downloads","issues_url":"https://api.github.com/repos/ecnahc515/fleet/issues{/number}","pulls_url":"https://api.github.com/repos/ecnahc515/fleet/pulls{/number}","milestones_url":"https://api.github.com/repos/ecnahc515/fleet/milestones{/number}","notifications_url":"https://api.github.com/repos/ecnahc515/fleet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecnahc515/fleet/labels{/name}","releases_url":"https://api.github.com/repos/ecnahc515/fleet/releases{/id}","created_at":"2015-01-21T21:46:35Z","updated_at":"2015-01-21T21:46:38Z","pushed_at":"2015-01-28T20:18:39Z","git_url":"git://github.com/ecnahc515/fleet.git","ssh_url":"git@github.com:ecnahc515/fleet.git","clone_url":"https://github.com/ecnahc515/fleet.git","svn_url":"https://github.com/ecnahc515/fleet","homepage":"","size":6217,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"420afd8bca0c0a6ca8385c6530cf16bf0a7858cc","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":13512328,"name":"fleet","full_name":"coreos/fleet","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/fleet","description":"A Distributed init System","fork":false,"url":"https://api.github.com/repos/coreos/fleet","forks_url":"https://api.github.com/repos/coreos/fleet/forks","keys_url":"https://api.github.com/repos/coreos/fleet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/fleet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/fleet/teams","hooks_url":"https://api.github.com/repos/coreos/fleet/hooks","issue_events_url":"https://api.github.com/repos/coreos/fleet/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/fleet/events","assignees_url":"https://api.github.com/repos/coreos/fleet/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/fleet/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/fleet/tags","blobs_url":"https://api.github.com/repos/coreos/fleet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/fleet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/fleet/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/fleet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/fleet/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/fleet/languages","stargazers_url":"https://api.github.com/repos/coreos/fleet/stargazers","contributors_url":"https://api.github.com/repos/coreos/fleet/contributors","subscribers_url":"https://api.github.com/repos/coreos/fleet/subscribers","subscription_url":"https://api.github.com/repos/coreos/fleet/subscription","commits_url":"https://api.github.com/repos/coreos/fleet/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/fleet/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/fleet/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/fleet/issues/comments/{number}","contents_url":"https://api.github.com/repos/coreos/fleet/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/fleet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/fleet/merges","archive_url":"https://api.github.com/repos/coreos/fleet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/fleet/downloads","issues_url":"https://api.github.com/repos/coreos/fleet/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/fleet/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/fleet/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/fleet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/fleet/labels{/name}","releases_url":"https://api.github.com/repos/coreos/fleet/releases{/id}","created_at":"2013-10-11T23:56:38Z","updated_at":"2015-01-30T19:56:55Z","pushed_at":"2015-01-27T20:22:13Z","git_url":"git://github.com/coreos/fleet.git","ssh_url":"git@github.com:coreos/fleet.git","clone_url":"https://github.com/coreos/fleet.git","svn_url":"https://github.com/coreos/fleet","homepage":"","size":11638,"stargazers_count":1513,"watchers_count":1513,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":163,"mirror_url":null,"open_issues_count":90,"forks":163,"open_issues":90,"watchers":1513,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1097"},"html":{"href":"https://github.com/coreos/fleet/pull/1097"},"issue":{"href":"https://api.github.com/repos/coreos/fleet/issues/1097"},"comments":{"href":"https://api.github.com/repos/coreos/fleet/issues/1097/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1097/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/fleet/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1097/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/fleet/statuses/ff36ad75813113975cbcc25f3b939b1489a48b74"}}}}