Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept connection options in shared bus getters #375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type Conn struct {

// SessionBus returns a shared connection to the session bus, connecting to it
// if not already done.
func SessionBus() (conn *Conn, err error) {
func SessionBus(opts ...ConnOption) (conn *Conn, err error) {
sessionBusLck.Lock()
defer sessionBusLck.Unlock()
if sessionBus != nil &&
Expand All @@ -69,7 +69,7 @@ func SessionBus() (conn *Conn, err error) {
sessionBus = conn
}
}()
conn, err = ConnectSessionBus()
conn, err = ConnectSessionBus(opts...)
return
}

Expand Down Expand Up @@ -116,7 +116,7 @@ func SessionBusPrivateHandler(handler Handler, signalHandler SignalHandler) (*Co

// SystemBus returns a shared connection to the system bus, connecting to it if
// not already done.
func SystemBus() (conn *Conn, err error) {
func SystemBus(opts ...ConnOption) (conn *Conn, err error) {
systemBusLck.Lock()
defer systemBusLck.Unlock()
if systemBus != nil &&
Expand All @@ -128,7 +128,7 @@ func SystemBus() (conn *Conn, err error) {
systemBus = conn
}
}()
conn, err = ConnectSystemBus()
conn, err = ConnectSystemBus(opts...)
return
}

Expand Down