Documentation
¶
Index ¶
- type DbusConn
- type GeoClue2
- type Location
- type MockBusObject
- func (o *MockBusObject) AddMatchSignal(iface, member string, options ...dbus.MatchOption) *dbus.Call
- func (o *MockBusObject) Call(method string, flags dbus.Flags, args ...interface{}) *dbus.Call
- func (o *MockBusObject) CallWithContext(ctx context.Context, method string, flags dbus.Flags, args ...interface{}) *dbus.Call
- func (o *MockBusObject) Destination() string
- func (o *MockBusObject) GetProperty(p string) (dbus.Variant, error)
- func (o *MockBusObject) Go(method string, flags dbus.Flags, ch chan *dbus.Call, args ...interface{}) *dbus.Call
- func (o *MockBusObject) GoWithContext(ctx context.Context, method string, flags dbus.Flags, ch chan *dbus.Call, ...) *dbus.Call
- func (o *MockBusObject) Path() dbus.ObjectPath
- func (o *MockBusObject) RemoveMatchSignal(iface, member string, options ...dbus.MatchOption) *dbus.Call
- func (o *MockBusObject) SetProperty(p string, v interface{}) error
- type MockDbusConn
- type RealDbusConn
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoClue2 ¶
type GeoClue2 struct {
// contains filtered or unexported fields
}
GeoClue2 is used for receiving location information from the geoclue2 service.
func NewGeoClue2 ¶
NewGeoClue2 is used to create a new GeoClue2 struct.
func (*GeoClue2) GetLatestLocation ¶
GetLatestLocation returns the last location received from geoclue2.
func (*GeoClue2) Start ¶
func (g *GeoClue2) Start()
Start starts the main loop that receives and distributes location updates.
type Location ¶
type Location struct { // The latitude of the location, in degrees. Latitude float64 `dbus:"Latitude"` // The longitude of the location, in degrees. Longitude float64 `dbus:"Longitude"` // The accuracy of the location fix, in meters. Accuracy float64 `dbus:"Accuracy"` // The altitude of the location fix, in meters. When unknown, its set to // minimum double value, -1.7976931348623157e+308. Altitude float64 `dbus:"Altitude"` // The speed in meters per second. When unknown, it's set to -1.0. Speed float64 `dbus:"Speed"` // The heading direction in degrees with respect to North direction, in // clockwise order. That means North becomes 0 degree, East: 90 degrees, // South: 180 degrees, West: 270 degrees and so on. When unknown, it's set // to -1.0. Heading float64 `dbus:"Heading"` // A human-readable description of the location, if available. // WARNING: Applications should not rely on this property since not all // sources provide a description. If you really need a description (or more // details) about current location, use a reverse-geocoding API, e.g // geocode-glib. Description string `dbus:"Description"` // The timestamp when the location was determined, in seconds and // microseconds since the Epoch. This is the time of measurement if the // backend provided that information, otherwise the time when GeoClue // received the new location. Note that GeoClue can't guarantee that the // timestamp will always monotonically increase, as a backend may not // respect that. Also note that a timestamp can be very old, e.g. because // of a cached location. Timestamp Timestamp `dbus:"Timestamp"` }
Location contains location information returned by geoclue2.
type MockBusObject ¶
type MockBusObject struct { DoCall func(method string, flags dbus.Flags, args ...interface{}) *dbus.Call DoCallWithContext func(ctx context.Context, method string, flags dbus.Flags, args ...interface{}) *dbus.Call DoGo func(method string, flags dbus.Flags, ch chan *dbus.Call, args ...interface{}) *dbus.Call DoGoWithContext func(ctx context.Context, method string, flags dbus.Flags, ch chan *dbus.Call, args ...interface{}) *dbus.Call DoAddMatchSignal func(iface, member string, options ...dbus.MatchOption) *dbus.Call DoRemoveMatchSignal func(iface, member string, options ...dbus.MatchOption) *dbus.Call DoGetProperty func(p string) (dbus.Variant, error) DoSetProperty func(p string, v interface{}) error DoDestination func() string DoPath func() dbus.ObjectPath }
func (*MockBusObject) AddMatchSignal ¶
func (o *MockBusObject) AddMatchSignal(iface, member string, options ...dbus.MatchOption) *dbus.Call
func (*MockBusObject) CallWithContext ¶
func (*MockBusObject) Destination ¶
func (o *MockBusObject) Destination() string
func (*MockBusObject) GetProperty ¶
func (o *MockBusObject) GetProperty(p string) (dbus.Variant, error)
func (*MockBusObject) GoWithContext ¶
func (*MockBusObject) Path ¶
func (o *MockBusObject) Path() dbus.ObjectPath
func (*MockBusObject) RemoveMatchSignal ¶
func (o *MockBusObject) RemoveMatchSignal(iface, member string, options ...dbus.MatchOption) *dbus.Call
func (*MockBusObject) SetProperty ¶
func (o *MockBusObject) SetProperty(p string, v interface{}) error
type MockDbusConn ¶
type MockDbusConn struct { DoSignal func(ch chan<- *dbus.Signal) DoObject func(iface string, path dbus.ObjectPath) dbus.BusObject }
func (*MockDbusConn) Object ¶
func (d *MockDbusConn) Object(iface string, path dbus.ObjectPath) dbus.BusObject
func (*MockDbusConn) Signal ¶
func (d *MockDbusConn) Signal(ch chan<- *dbus.Signal)
type RealDbusConn ¶
type RealDbusConn struct {
// contains filtered or unexported fields
}
func (*RealDbusConn) Object ¶
func (d *RealDbusConn) Object(iface string, path dbus.ObjectPath) dbus.BusObject
func (*RealDbusConn) Signal ¶
func (d *RealDbusConn) Signal(ch chan<- *dbus.Signal)
Click to show internal directories.
Click to hide internal directories.