2
Copyright 2014 Canonical Ltd.
4
This program is free software: you can redistribute it and/or modify it
5
under the terms of the GNU General Public License version 3, as published
6
by the Free Software Foundation.
8
This program is distributed in the hope that it will be useful, but
9
WITHOUT ANY WARRANTY; without even the implied warranties of
10
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along
14
with this program. If not, see <http://www.gnu.org/licenses/>.
17
// Package polld wraps the account-polld dbus interface
23
"launchpad.net/ubuntu-push/bus"
24
"launchpad.net/ubuntu-push/logger"
28
ErrUnconfigured = errors.New("unconfigured.")
31
// polld lives on a well-known bus.Address
32
var BusAddress bus.Address = bus.Address{
33
Interface: "com.ubuntu.AccountPolld",
34
Path: "/com/ubuntu/AccountPolld",
35
Name: "com.ubuntu.AccountPolld",
38
type Polld interface {
40
WatchDones() (<-chan bool, error)
48
func New(endp bus.Endpoint, log logger.Logger) Polld {
49
return &polld{endp, log}
52
func (p *polld) Poll() error {
54
return ErrUnconfigured
56
return p.endp.Call("Poll", nil)
59
func (p *polld) WatchDones() (<-chan bool, error) {
61
return nil, ErrUnconfigured
64
p.endp.WatchSignal("Done", func(...interface{}) {
66
}, func() { close(ch) })