2021-11-21 23:05:13 -05:00
|
|
|
package gosecret
|
2021-11-21 18:07:52 -05:00
|
|
|
|
|
|
|
import (
|
|
|
|
`github.com/godbus/dbus`
|
|
|
|
)
|
|
|
|
|
|
|
|
// NewSession returns a pointer to a new Session based on a Dbus connection and a Dbus path.
|
|
|
|
func NewSession(conn *dbus.Conn, path dbus.ObjectPath) (session *Session) {
|
|
|
|
|
|
|
|
session = &Session{
|
|
|
|
Conn: conn,
|
2021-11-26 00:01:49 -05:00
|
|
|
Dbus: conn.Object(DbusServiceName, path),
|
2021-11-21 18:07:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// Path returns the path of the underlying Dbus connection.
|
|
|
|
func (s Session) Path() (path dbus.ObjectPath) {
|
|
|
|
|
|
|
|
// Remove this method in V1. It's bloat since we now have an exported Dbus.
|
|
|
|
path = s.Dbus.Path()
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|